Website for The New Division — www.thenewdivision.world
- SvelteKit (Svelte 5) + Vite
- Prismic CMS (
@prismicio/client/@prismicio/svelte), repothenewdivision - Deployed to Cloudflare Pages (
@sveltejs/adapter-cloudflare), fully prerendered to static HTML - Images transformed via Cloudflare Image Transformations (
/cdn-cgi/image/...)
npm install
npm run dev # http://localhost:5173 — images load directly from Prismic
npm run build # prerenders every page; output in .svelte-kit/cloudflare
npm run preview # serve the production build locally- Build command:
npm run build· Output dir:.svelte-kit/cloudflare - No environment variables are required (the Prismic repo is public; images use URL transforms).
- Prerequisite: enable Image Transformations on the
thenewdivision.worldCloudflare zone and allow transforming images from theimages.prismic.ioorigin. Without it,/cdn-cgi/image/...URLs won't resolve.
Content is prerendered, so publishing in Prismic must rebuild the site:
- Cloudflare Pages → project → Settings → Builds & deployments → Deploy hooks → create a hook, copy the URL.
- Prismic → Settings → Webhooks → add that URL.
Publishing any document then triggers a rebuild + deploy.
Prismic preview works via /api/preview and /api/exit-preview (Cloudflare Functions) plus
<PrismicPreview>; draft content is fetched client-side when a preview session is active.
src/routes/[[lang=lang]]/[...uid]/— page route (English at/, Swedish under/sv)src/lib/components/— UI components (CSS reused verbatim undersrc/styles/)src/lib/prismicio.js— Prismic client ·src/lib/image.js— Cloudflare image URLsstatic/_redirects— legacy URL redirects