To use LuaWebGen, navigate to your site's root folder and run this from the command line:
webgen command [options]
or, in the universal version:
lua path/to/webgen.lua command [options]
webgen build [options]
Build the website (i.e. process files in the content folder and write the results to the output folder). Also look at the available build options.
webgen new site <folderName>
Initialize a folder to contain a new site. Example:
webgen new site "internet-dogs" cd "internet-dogs" webgen new page "blog/first-post.md" webgen build
webgen new page <pagePath>
Create a new page with some basic information. Example:
webgen new page "blog/first-post.md"
webgen new feed [<feedPath>]
Create a new RSS feed.
A feed lists all (sub)pages from newest to oldest by default.
The default path, if none is given, is
webgen new sitemap
Create a sitemap file (
Auto-build website when changes are detected. This makes LuaWebGen run until you press
Ctrl+C in the command prompt.
config.baseUrl with another value.
Include page drafts when building.
Force-update all. This makes LuaWebGen treat all previously outputted files as if they were modified. This has the same effect as deleting the output folder.
Show absolute paths to files in the console and the log.
Output metaprograms to the folder
Metaprograms are what LuaWebGen generates from templates, and when they run they in turn generate the resulting file (webpage or whatever).
These can be used for debugging.
Disable Lua's garbage collector. This might decrease the build time.
Enable verbose printing to the console. (Verbose messages are still logged whether this option is present or not.)
Page updated: 2021-07-07