Skip to content

Wiki Editor Setup

The documentation site includes an in-page editor for the two approved project editors. Cloudflare Access supplies identity; Pages Functions write changes to a shared GitHub draft branch.

Protect both of these paths with the same Access application and exact-email allow policy:

  • docs.sitraachra.com/*
  • docs.sitraachra.com/api/*

The API trusts the authenticated email supplied by Cloudflare Access and then checks it against EDITOR_EMAILS.

Open Workers & Pages → the documentation project → Settings → Variables and Secrets.

Add:

Name Type Value
GITHUB_TOKEN Encrypted secret Fine-grained GitHub token with Contents read/write access to ericas-incantations/Sitra-Achra
EDITOR_EMAILS Variable The two approved email addresses, comma-separated
GITHUB_REPO Variable ericas-incantations/Sitra-Achra
DRAFT_BRANCH Variable wiki-drafts
MAIN_BRANCH Variable main

Never place GITHUB_TOKEN in the repository, browser JavaScript, or a public environment variable.

Only main should produce Cloudflare builds.

Under Builds & deployments → Branch control:

  • Production branch: main
  • Preview branch builds: disabled, or configured to exclude wiki-drafts and agent/*

Every editor save creates a Git commit on wiki-drafts. Allowing preview builds for that branch would recreate the large deployment queue the draft workflow is designed to avoid.

  1. Sign in through Cloudflare Access.
  2. Use Edit page, New page, or Add image in the floating toolbar.
  3. Save as often as needed. All saves go to wiki-drafts.
  4. Either editor can continue from the shared branch.
  5. Use Publish drafts once the batch is ready.
  6. Publishing fast-forwards main once, creating one production deployment.

The editor accepts:

  • drag-and-drop local images;
  • file selection;
  • direct HTTP or HTTPS image URLs.

Supported formats are JPEG, PNG, WebP, GIF, and AVIF, up to 8 MB. Files are written beneath site/public/references/images/uploads/, and metadata is appended to site/src/data/reference-images.json.

A pasted URL must point directly to an image response. Web pages such as Pinterest, Behance, or museum record pages should be entered as the source page while the actual image file is uploaded separately.

Write [[Page Title]] in Markdown. During the build, the site generates a title index for every documentation page. On rendered pages, matching titles become internal links automatically.

The link text must match the target page’s frontmatter title exactly, ignoring capitalization.

Publishing is deliberately refused when main has diverged from wiki-drafts. This prevents the editor from overwriting repository work made outside the web interface. Resolve or reset the draft branch before publishing again.