Hua (simplified Chinese for flower) is a simple, feature-rich, static content generator useful for maintaining web sites and blogs with templates.
Hua was originally written in the Ruby scripting language and was inspired in part by the venerable Perl-based blogging tool Blosxom and similar static content generators. It has since been rewritten in PowerShell. Simplicity is one of its core principles: The database containing site entries, site content, includes, and template files are all maintained in plain text. Comments are provided through a through a third-party engine like Disqus or IntenseDebate. Hua is open source software (MIT License).
Hua was written using PowerShell version 5.1 and tested on Windows 10. It should run on any reasonably up-to-date PowerShell installation. An example site (config file, entries file, and content) is included in the distribution so you can try it out immediately.
Hua supports Markdown using the MarkdownToHTML module.
Hua Revision 43 - Sat Dec 10 2022 (Hua.zip, 31K)
--
instead of ~~
. In order to use this version of Hua, all templates must be updated to reflect this.--article_tags--
and --master_tags--
need no longer be enclosed in <ul>
tags.Hua is run from the command line by specifying the Hua script and config file. For example: .\hua.ps1 .\hua.cfg
.
The Hua config file specifies the locations of the support files and variables used by Hua (article meta info, output/content/include directories, URLs).
Hua files and config variables: entries_file Delimited text file of blog entries content_dir Directory of the blog content output_dir Directory of the blog output HTML index_file File path of the primary blog page archive_file File path of page listing all article titles include_dir Directory of the various includes header_file File path of header include footer_file File path of footer include read_more_file File name of "Read More..." include comments_file File name of comments include blog_root The web accessible root of the blog web_root The web accessible root of the web site entries_file = .\entries.csv content_dir = .\content output_dir = .\blog index_file = .\blog\index.html archive_file = .\blog\archive.html include_dir = .\content\inc header_file = .\content\inc\header.html footer_file = .\content\inc\footer.html read_more_file= .\content\inc\read_more.html comments_file = .\content\inc\comments.html blog_root = /blog/ web_root = http://example.local
The entries file is a comma delimited plain-text database of articles. It can be edited with a text editor or a spreadsheet application (provided the plain-text format is preserved). Each line consists of the following fields:
content_dir
.http://
) or email (precede with mailto:
) associated with the article.Hua is normally silent, so if everything goes well nothing will be output on the command line and Hua will exit with a status of 0
. Errors will be output in the following situations:
1
.1
.1
.1
.1
.1
.output_dir
and run Hua again.-o
or --orphans
as the second argument to list files in the output_dir
that are not referenced in the entries_file
. If there are no orphans, nothing is output. Content is not processed in this mode.