blogin serve

Build the site and serve it locally, rebuilding when content, layouts, static assets, data files, or the configuration change. A successful rebuild live-reloads the open page in the browser.

blogin serve [--src <dir>] [--port <n>] [--verbose]

Options#

-s, --src <dir>
the content directory. It defaults to content.
-p, --port <n>
the port to listen on. It defaults to 3000.
-v, --verbose
prints a line per request.

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

Example#

blogin serve --port 4000

The server binds loopback only, so it is reachable from the machine it runs on and nowhere else. minify and fingerprint are off while serving, whatever blogin.json says, and the server prints a line saying so when the config asks for them.

Where it builds#

A preview is built into .blogin-preview/, not the output directory in blogin.json. Serving a site therefore never writes the directory you deploy, so a preview cannot leave unminified, unfingerprinted assets where a deploy would pick them up. The preview keeps its own build state, so a preview and a release never read each other's.

Add .blogin-preview/ to .gitignore. blogin clean removes it along with the output directory. See Previewing and Building.