Back to Home
Coastal cliff and lighthouse at blue hour
documentation

Deploying to Cloudflare Pages

How this template is built, checked, and deployed from the umbrella — static, Access, or CMS.

By Farend • Published August 17, 2026

Parked sites in this workspace deploy as Cloudflare Pages projects. From the umbrella root, the vocabulary command is deploy <repo-name> — it runs ./scripts/deploy-repo.sh, which reads the Pages project name and output directory from that site's wrangler.toml.

The template playground is special: deploy template runs ./scripts/deploy-template-preview.sh (not deploy-repo.sh). That path composes the CMS overlay, syncs content/ into seed, and can re-seed D1.

What the deploy script does

  1. npm run check when the site has that script (skip with --skip-check).
  2. Applies D1 migrations for every configured database that has a migrations_dir.
  3. npm run build when a build script exists.
  4. npx wrangler pages deploy using pages_build_output_dir (build/ for static, .svelte-kit/cloudflare for CMS).

Config that must be real

  • name matches the Cloudflare Pages project.
  • database_id is a real D1 id, not PLACEHOLDER-D1-DATABASE-ID (contacts DB on every site; CMS sites also have a content database and R2 media).
  • Turnstile keys are the shared org widget — add the production hostname in the Turnstile dashboard. MAILGUN_API_KEY is per-site.
  • CMS /admin expects Cloudflare Access on parked sites. Do not copy CMS_PREVIEW_BYPASS onto production.

Local preview

test <repo-name> means check + build, then a local wrangler pages dry-run. Vite npm run dev does not load Turnstile; use a built preview to exercise the widget. Access-gated member routes and CMS admin need the matching bypass vars only on localhost.

#cloudflare#deploy#wrangler

Farend Static Template Site

Modular SvelteKit starter — static markdown base, optional Access and CMS add-ons, eight presets, self-hosted fonts.

© 2026 Farend Static Template Site. All rights reserved.