Host the docs and playground
The docs site and the playground are static files. They need no server, no secrets and no provider accounts.
Build
pnpm install
pnpm site:buildThis command builds the packages, the docs and the playground. The output is in docs/.vitepress/dist. The playground is in docs/.vitepress/dist/playground/.
The base path
The DOCS_BASE environment variable sets the public path of the site. The docs and the playground both use it.
| Host | DOCS_BASE |
|---|---|
Vercel (the public site, https://openrampkit.vercel.app) | Do not set it (the default is /) |
| Custom domain, or Cloudflare Pages | Do not set it |
GitHub Pages project site (https://yosriady.github.io/openrampkit/) | /openrampkit/ |
DOCS_BASE=/openrampkit/ pnpm site:buildVercel
The public site at openrampkit.vercel.app runs on Vercel.
- Import the repository as a new Vercel project.
- Set Framework Preset to Other.
- Set Build Command to
pnpm site:build. - Set Output Directory to
docs/.vitepress/dist. - Do not set
DOCS_BASE.
The vercel.json file at the repository root sets cleanUrls: true. Then /guide/why serves guide/why.html, as the docs links expect.
Vercel deploys each push to main. Commits must be signed.
GitHub Pages
The workflow .github/workflows/docs.yml deploys the site on each push to main. You can also start it by hand from the Actions tab.
Do these steps one time:
- Go to Settings > Pages.
- Set Source to GitHub Actions.
GitHub Pages for a private repository needs a paid plan. On a free plan, make the repository public.
For a custom domain, set the domain in Settings > Pages. Then remove DOCS_BASE from the workflow.
Cloudflare Pages
- Create a Pages project and connect the repository.
- Set Build command to
pnpm site:build. - Set Build output directory to
docs/.vitepress/dist. - Set the environment variable
NODE_VERSIONto22.
Do not set DOCS_BASE. Cloudflare Pages serves the site at the root.