Deploy these docs
This site is built with Astro + Starlight and deploys as static files to Cloudflare Pages. Here’s how to build and ship it yourself.
Local development
Section titled “Local development”npm installnpm run dev # http://localhost:4321Build and preview the production output:
npm run build # outputs to ./distnpm run previewDeploy to Cloudflare Pages
Section titled “Deploy to Cloudflare Pages”Option A — Git integration (recommended)
Section titled “Option A — Git integration (recommended)”- Push this repo to GitHub/GitLab.
- In the Cloudflare dashboard: Workers & Pages → Create → Pages → Connect to Git, and select the repo.
- Set the build settings:
- Framework preset: Astro
- Build command:
npm run build - Build output directory:
dist
- Save and deploy. Every push to your default branch publishes automatically, and pull requests get preview URLs.
Option B — Direct upload with Wrangler
Section titled “Option B — Direct upload with Wrangler”Build locally and push the dist/ folder straight to Pages:
npm run buildnpx wrangler pages deploy ./dist --project-name imgsqz-docsThe included deploy script wraps both steps:
npm run deployWhy Cloudflare Pages fits
Section titled “Why Cloudflare Pages fits”- Static output — Starlight builds plain HTML/CSS/JS, served from Cloudflare’s global edge with no server to run.
- Built-in search — Starlight bundles Pagefind, which runs fully client-side, so search works on a static host with zero backend.
- Instant cache invalidation & previews — every deploy is atomic, and PRs get isolated preview URLs.
Configuration files
Section titled “Configuration files”astro.config.mjs— Starlight config (nav, theme, metadata).wrangler.jsonc— Cloudflare project name and the Pages build output dir.public/_headers— long-lived caching for hashed assets, sensible defaults for HTML.
Custom domain
Section titled “Custom domain”In Pages → your project → Custom domains, add your domain and follow the DNS prompt. Cloudflare provisions TLS automatically.