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 Revision 15 - Thu 14 Jan 2021 (Hua.zip, 115K)
Hua is run from the command line by specifying the Hua script and config file. For example:
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 tags_file File name of the tag list 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 tags_file = .\content\inc\tags.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:
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:
output_dirand run Hua again.
--orphansas the second argument to list files in the
output_dirthat are not referenced in the
entries_file. If there are no orphans, nothing is output. Content is not processed in this mode.