blogin clean

Remove the output directory produced by a build, leaving the content, layouts, and configuration in place.

blogin clean [--src <dir>] [--out <dir>]

Options#

-s, --src <dir>
the content directory. It defaults to content. The blogin.json beside it names the output directory, and its parent is the site directory.
-o, --out <dir>
the directory to remove. Naming one makes it the only target.

With no --out, both directories a build can write are removed: the output-dir from blogin.json, or public when the config does not set one, and .blogin-preview/, where blogin serve builds. Each is reported separately, and one that does not exist is skipped.

The target must sit inside the site directory, the parent of --src, which is the current directory by default. A path outside it, or the site directory itself, is refused so a stray --out cannot delete unrelated files. The command reports how many files it removed.

A .keep file is yours rather than build output, so it survives, and so does the directory holding it. Keep one at public/.keep to track the output directory in version control.

Every option also has a one-letter spelling, listed on blogin build.

Example#

blogin clean --out dist