A minimal blog on a single Cloudflare Worker.
- Posts live in
content/posts/**.md(frontmatter:title,date,tags,summary, optionallastmod,draft).content/about.mdis the about page. npm run buildrenders markdown to HTML once intosrc/posts.generated.js; the Worker (src/worker.js) only does routing and templating.- Every response (pages, feed, 404s, redirects and static files) is cached for 10 minutes in the browser and at the Cloudflare edge. The edge cache key includes a content hash, so a new deploy never serves stale pages from an older build.
public/(favicons, images) is served by Workers static assets.
npm install
npm run dev # local preview
npm run deploy # needs CLOUDFLARE_API_TOKENThe Cache API only works on custom domains, not *.workers.dev, so attach sorsby.co as a route or custom domain. CI (.github/workflows/deploy.yml) needs CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID secrets.