跳转至

Cloudflare Pages Publishing

This site is built with MkDocs Material and deployed on Cloudflare Pages.

Build Settings

Setting Value
Production branch master
Framework preset None
Build command pip install -r docs-requirements.txt && mkdocs build
Build output directory site

Environment Variables (optional)

Variable Value Purpose
PYTHON_VERSION 3.12 Ensure compatible Python version

Local Development

pip install -r docs-requirements.txt
mkdocs serve

Then open http://127.0.0.1:8000.

How It Works

  1. Cloudflare Pages runs the build command on every push to main.
  2. mkdocs build reads mkdocs.yml and compiles docs/ into site/.
  3. Cloudflare serves the site/ directory as a static site.

Warning

Do NOT place _redirects or _headers files in docs/. They can override Content-Type or rewrite paths, causing MkDocs-built HTML to be served as raw markdown. If you need CF Pages headers/redirects, place them in a custom directory and use MkDocs custom_dir to inject them into site/.