Deploy Docs
This docs site uses VitePress + VitePress Theme Teek. All content lives inside doc/, and the build output is a static site suitable for Cloudflare Pages.
Local development
cd doc
npm install
npm run devBuild static files
cd doc
npm run buildThe output directory is:
doc/.vitepress/distPublish that directory to any static hosting service.
Recommended: Cloudflare Pages
Option A: set Cloudflare Root directory to doc
This is the preferred setup.
| Setting | Recommended value |
|---|---|
| Framework preset | VitePress |
| Root directory | doc |
| Build command | npm run build |
| Build output directory | .vitepress/dist |
| Environment variable | DOCS_BASE=/ |
| Node.js | NODE_VERSION=22.16.0 or a newer 22/24 LTS version |
Steps:
- Open Cloudflare Dashboard and go to Workers & Pages / Pages.
- Choose Create application, then Pages.
- Connect the Git repository:
https://github.com/fantasy-ke/FkeMark. - Choose the production branch based on your release strategy:
mainfor stable docs,devfor preview docs. - Fill in the build settings above.
- Save and deploy. Cloudflare will install dependencies, build the docs, and publish
.vitepress/dist.
Option B: keep Root directory at repository root
If the Cloudflare project must keep the repository root, use explicit doc commands:
| Setting | Value |
|---|---|
| Framework preset | None or VitePress |
| Root directory | empty or repository root |
| Build command | npm --prefix doc ci && npm --prefix doc run build |
| Build output directory | doc/.vitepress/dist |
| Environment variable | DOCS_BASE=/ |
Cloudflare headers
doc/public/_headers is copied to the build output root. It configures:
- Basic security headers for all pages.
- Long cache for VitePress static assets.
- Shorter cache for the reusable theme CSS so visual updates can ship safely.
GitHub Pages
The repository URL is:
https://github.com/fantasy-ke/FkeMarkFor GitHub Pages, the expected URL is:
https://fantasy-ke.github.io/FkeMark/The config automatically uses /FkeMark/ as base in GitHub Actions. For root-domain deployment, set:
DOCS_BASE=/ npm run buildWhy VitePress
| Framework | Best for | Decision |
|---|---|---|
| VitePress | Markdown-first, lightweight static docs | Best fit for this Vite/npm project |
| Docusaurus | Large docs and versioning | Powerful but heavier |
| Astro Starlight | Content sites, built-in nav/search/i18n | Good, but introduces Astro ecosystem |
| Nextra | Next.js + MDX docs | Better for existing Next.js projects |
For this project’s home page, guide, theme docs, and deployment notes, VitePress is the smallest maintainable choice, with Teek as the theme enhancement layer.
Troubleshooting
Styles or icons return 404
Check DOCS_BASE:
- Cloudflare Pages root domain:
DOCS_BASE=/ - GitHub Pages repository page:
DOCS_BASE=/FkeMark/ - Custom subpath: set the real subpath, for example
DOCS_BASE=/docs/
Cloudflare build fails
The VitePress/Teek dependency chain needs a recent Node.js runtime. Set:
NODE_VERSION=22.16.0A validated 24 LTS version can also be used later.
Cloudflare cannot find the output directory
Make sure Root directory and Build output directory match:
- Root directory is
doc: output directory should be.vitepress/dist. - Root directory is repository root: output directory should be
doc/.vitepress/dist.