Skip to content

Cloudflare Pages Deployment

This project is intended to be previewed locally with MkDocs and deployed as a static site through Cloudflare Pages.

Local Build

pip install -r requirements.txt
mkdocs build

MkDocs outputs the static site to:

site/

Cloudflare Pages Settings

Recommended settings:

Setting Value
Framework preset None or MkDocs
Build command mkdocs build
Build output directory site
Root directory /
Production branch main or selected docs branch

Python Dependencies

Keep dependencies in:

requirements.txt

Typical content:

mkdocs-material

Private Repository Workflow

A suitable workflow is:

local edit
mkdocs serve
commit and push to private GitHub repo
Cloudflare Pages build
static documentation site

Common Checks

Before pushing:

mkdocs build --strict

After deployment:

  • open the Cloudflare Pages URL
  • check navigation
  • test search
  • verify custom CSS and JavaScript are loaded
  • verify font scaling still works

Common Issues

Missing dependency

If Cloudflare build fails because MkDocs or the Material theme is missing, check requirements.txt.

Wrong output directory

Cloudflare Pages must publish the site directory, not docs.

Run locally:

mkdocs build --strict

This usually catches broken nav paths before deployment.