blogin build

Render the content tree to static HTML, writing feeds, a sitemap, and the search index alongside the pages.

blogin build [--src <dir>] [--out <dir>] [--drafts] [--future] [--jobs <n>]
             [--debug] [--no-debug] [--force] [--counters] [--verbose]

Options#

-s, --src <dir>
the content directory. It defaults to content. The blogin.json next to it supplies the configuration, and everything else is found beside it.
-o, --out <dir>
overrides the output-dir from the config. The path is relative to the current directory, where output-dir is relative to the site directory.
-d, --drafts
includes posts marked draft: true.
-F, --future
includes posts dated ahead of today, which are excluded by default.
-j, --jobs <n>
render threads. It defaults to one per core, and a value below 1 means 1.
-D, --debug
turns on the debug-open and debug-close helpers, which write a begin and end comment wherever a layout calls them. The scaffolded layouts mark the header, the footer, and the page template, so a page says which layout produced what.
-N, --no-debug
turns that off for a site whose config sets "debug": true.
-f, --force
rebuilds everything, ignoring what the last build recorded.
-c, --counters
prints the work the build did: posts parsed, templates compiled, pages rendered, files read and written, directory walks, and related-post terms.
-v, --verbose
names the directories it read and prints the work counters.

Example#

blogin build --out dist --force

Short options#

Every option has a one-letter spelling, and it means the same thing on every command:

-s --src -o --out -S --section -w --framework
-j --jobs -p --port -d --drafts -F --future
-f --force -D --debug -N --no-debug -c --counters
-v --verbose -V --version

So blogin build -o dist -f is blogin build --out dist --force.

They combine into one argument the usual way, so -fv is --force --verbose written short, and blogin build -dFcv turns on drafts, future posts, counters, and verbose output at once.

An option taking a value can end a run but cannot sit inside one, since the value is the next argument and there is only one of those. -fo dist works and -of dist is refused, naming the letter:

$ blogin build -of dist
blogin: '-o' wants a value, so it has to come last in '-of'

$ blogin build -fZv
blogin: unknown option '-Z' in '-fZv'

A value may itself begin with a dash. blogin build -o -weird writes to a directory called -weird rather than reading the letters as options.

blogin with no command prints this table. blogin --version, or -V anywhere on the line, prints the version and exits.

Errors#

An unknown flag, a value flag with nothing after it, a number that is not one, or a positional argument a command does not take (any for build, serve, and clean, or a second one for init and new) stops the command with a message naming what was wrong and exit status 2. Every command accepts every option and ignores the ones it does not use. A flag takes the next argument, so write --out dist with a space rather than --out=dist.