Deploy docs (Cloudflare Pages)¶
We deploy the documentation site using Cloudflare Pages (Git integration). This works with private repos and avoids GitHub Pages limitations.
One-time setup (Cloudflare dashboard)¶
- Cloudflare Dashboard → Workers & Pages → Pages → Create a project
- Choose Connect to Git and authorize GitHub
- Select this repository and the branch you want to deploy (usually
main) - Project name:
keypool-docs
Build settings¶
Set these in the Pages project configuration (for project keypool-docs):
- Framework preset:
None - Build command:
bash
pip install -r requirements-docs.txt
mkdocs build --strict
- Build output directory:
site
Environment variables (advanced)¶
Add:
PYTHON_VERSION = 3.12
Cloudflare Pages will provision that Python version for the build.
Cloudflare Pages will run the build and publish the static output.
Custom domain (later)¶
When you're ready:
- Pages project → Custom domains → add your domain (e.g.
docs.keypool.lvtu.in) - After the domain is active, update
mkdocs.ymland set:
yaml
site_url: "https://docs.keypool.lvtu.in/"
This improves canonical URLs and social previews.
Scalar API reference¶
The Scalar page (docs/api-reference.md) loads the OpenAPI spec from docs/openapi.json at runtime using a relative URL. When the site is deployed, the spec will be available at:
/openapi.json
So the API reference works unchanged on Cloudflare Pages.