Command Line - ReFreezed/LuaWebGen GitHub Wiki

Note: The documentation has moved to the LuaWebGen website. Information here may be out of date!

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]

Commands

build

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.

new site

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

new page

webgen new page <pagePath>

Create a new page with some basic information. Example:

webgen new page "blog/first-post.md"

new feed

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 feed.xml.

new sitemap

webgen new sitemap

Create a sitemap file (sitemap.xml).

Build Options

--autobuild

--autobuild or -a

Auto-build website when changes are detected. This makes LuaWebGen run until you press Ctrl+C in the command prompt.

--date

--date <datetime>

Specify what date to build the website for (the default being "now"). The date affects what pages are included in the build depending on their publishDate value.

--drafts

--drafts or -d

Include page drafts when building.

--force

--force or -f

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.

--verbose

--verbose or -v

Enable verbose printing to the console. (Verbose messages are still logged whether this option is present or not.)

⚠️ **GitHub.com Fallback** ⚠️