Personal site: career timeline, side projects, and the blog (12 posts migrated from the old Jekyll site, 2012–2014). Static Astro site, deployed to Cloudflare Workers as static assets.
Needs Node 24 (Astro 7 requires ≥ 22.23.4). The version is pinned in .nvmrc.
nvm use
pnpm install
pnpm dev # http://localhost:4321
pnpm preview:cf # build + serve through Wrangler (tests _redirects and the 404 page)| What | Where |
|---|---|
| Bio, jobs, side projects, links | src/data/career.ts |
| Blog posts | src/content/blog/<slug>.md |
A new post needs only front matter like this. The file name becomes the URL (/blog/<slug>/).
---
title: "My new post"
date: 2026-11-20T09:00:00+02:00
description: "Optional. Used for search results and link previews."
---- Old post URLs (
/svn-vs-git/) return a 301 to/blog/svn-vs-git/viapublic/_redirects. Astro also writes a meta-refresh page at each old path as a fallback. - The RSS feed stays at
/feed.xml.
If you add a post, you don't need to touch _redirects. It only covers the 12 legacy URLs.
One-off from your machine
pnpm exec wrangler login
pnpm run deploy # astro build && wrangler deployThis creates a Worker named gmadar and prints a *.workers.dev preview URL.
Or on every push (after the code is on GitHub): Cloudflare dashboard → Workers & Pages → Create → Import a repository.
Build command pnpm build, deploy command npx wrangler deploy.
.nvmrc pins Node 24. If the build fails with "Node.js … is not supported by Astro", add a build variable NODE_VERSION = 24.
Until the move, the apex domain points at GitHub Pages (served from this repo), and www has no DNS record.
- In Cloudflare, add
gmadar.comas a site, then switch the nameservers at your registrar to the two Cloudflare gives you. - In Cloudflare DNS, delete the old GitHub Pages A records (
192.30.252.153and192.30.252.154) if they were imported. A Worker custom domain can't be added while other records exist for that hostname. - Deploy once (above). Then go to Workers & Pages →
gmadar→ Settings → Domains & Routes → Add → Custom domain, and addgmadar.com. Addwww.gmadar.comtoo, plus a redirect rule (Rules → Redirect Rules) sendingwwwto the apex. - In this repo on GitHub, turn off Pages (Settings → Pages), then delete the root
CNAMEfile. Until then, that file keeps GitHub Pages holding the domain, so nobody else can claim it while DNS still points at GitHub. - Check that
https://gmadar.com/svn-vs-git/redirects to/blog/svn-vs-git/and that/feed.xmlloads.
The site's "today" marker and job durations are computed at build time, so redeploy now and then to keep them current.