Cloudflare Pages Direct Upload¶
This repo is configured to publish the Markdown docs with MkDocs Material and deploy them directly to Cloudflare Pages without GitHub.
Local Preview¶
Install dependencies:
Run the local docs server:
Build the static site:
MkDocs writes the static output to site/.
Direct Upload With Wrangler¶
Wrangler is included as a local dev dependency for direct deployment.
Useful commands:
What they do:
cf:login: authenticates Wrangler with your Cloudflare accountcf:pages:create: creates a Pages direct-upload projectcf:deploy: rebuilds the docs and uploadssite/to Cloudflare Pages
For repeated deploys, the simplest Windows command is:
That command now defaults to the production branch so it updates the stable Pages URL.
Optional preview deploy:
First-Time Project Creation¶
Run:
Wrangler will prompt for:
- your Cloudflare login
- the Pages project name
- the production branch label for the direct-upload project
After the project exists, deploy with:
That script deploys to the production branch by default.
If you want to override the cached project and deploy to a specific Pages project immediately, use:
Dashboard Fallback¶
If you do not want to use Wrangler, Cloudflare also supports dashboard drag-and-drop uploads for the built site/ folder.
Minimal fallback flow:
- run
python -m mkdocs build - open Cloudflare Pages
- choose direct upload / drag and drop
- upload the built
site/folder
Wrangler is the better repeatable path. Drag and drop is only a manual fallback.
API Token Alternative¶
If you prefer token-based auth instead of browser login, Cloudflare supports direct upload with:
CLOUDFLARE_ACCOUNT_IDCLOUDFLARE_API_TOKEN
That is useful for CI later, but browser login is simpler for a local one-machine workflow.
Keep It Private¶
If the docs should not be public, put the Pages site behind Cloudflare Access.
Recommended pattern:
- deploy directly to Pages
- protect the Pages hostname with Cloudflare Access
- invite only the colleague email addresses that should be allowed to view it
Notes¶
- The docs source stays in
docs/. - MkDocs configuration lives in
mkdocs.yml. - The generated site output in
site/should not be committed. - Direct Upload projects cannot later be converted into Git-integrated Pages projects.