sladocs

Static Builds

Publish your docs as a static site with sladocs-build.

sladocs previews Markdown locally. To build a static site from the same docs, use its companion CLI, sladocs-build.

npx sladocs-build ./docs --out ./site

Serve the output with any static file server:

npx serve ./site

NOTE

sladocs-build bundles the full build toolchain, so its first run downloads more than sladocs. Keep using sladocs for day-to-day preview; reach for sladocs-build only when you publish.

Subpath hosting

When the site is not served from the domain root — for example a GitHub project page at https://user.github.io/repo/ — pass --base-path. Every link, asset, and asset route is rewritten to that prefix.

npx sladocs-build ./docs --out ./site --base-path /repo/

GitHub Pages

A ready-to-use workflow lives in the package at examples/github-pages.yml. It builds the site and deploys it with the official Pages actions, which serve the output as-is — including the _app directory — so no .nojekyll is needed.

If you publish to a gh-pages branch instead, add an empty .nojekyll to the output (touch ./site/.nojekyll) so Jekyll does not skip _app.

CLI reference

sladocs-build [dirs...] --out <dir> [options]

Arguments

ArgumentDescription
dirs...One or more directories to build, the same as sladocs. Defaults to the current working directory; multiple directories build a multi-project (tabbed) site. Ignored when projects is declared in sladocs.json.

Options

FlagShortDefaultDescription
--out <dir>-oOutput directory. Required.
--base-path <path>/Subpath the site is served from, e.g. /repo/.
--version-vShow the installed version.
--help-hShow usage.

On this page