yaakdoc

Deploying

Host the static site on Vercel, Netlify, GitHub Pages, Cloudflare Pages or any static host.

yaakdoc build writes a static site to dist/ (change it with outDir or --out-dir). There's no server to run: upload the folder to any static host.

npx yaakdoc build
npx yaakdoc preview   # check the result at http://localhost:4000

Before you deploy, set branding.url to the site's public URL. It gives you canonical URLs, a sitemap.xml and absolute links in llms.txt.

Serving from a subfolder

If the docs don't live at the root of their domain, e.g. https://acme.dev/docs/, set base:

yaakdoc.config.json
{
  "base": "/docs/"
}

or pass --base /docs/ to build. This is also what you need for GitHub Pages project sites (https://<user>.github.io/<repo>/).

To serve the docs from an app you already have, use an integration instead.

Hosts

The examples assume the docs live in a folder with yaakdoc in its package.json and a docs:build script (see Project setup). Without one, use npx yaakdoc build as the build command.

Import the repository in Vercel, choose Other as the framework preset, and set:

SettingValue
Build commandnpm run docs:build
Output directorydist

Building in CI

The export is a file in your repository, so docs builds are reproducible: re-export from Yaak (or use the Yaak plugin's Save as yaakdoc project...), commit, and let CI build. A failing build (for example, an invalid config) exits with a non-zero code.

To build several variants from one export, combine flags and --overrides:

npx yaakdoc build -e Production --out-dir dist/prod
npx yaakdoc build -e Sandbox --base /sandbox/ --out-dir dist/sandbox \
  --overrides '{"branding":{"title":"Acme API (Sandbox)"}}'

On this page