2025-05-12
My (Slightly Chaotic) Journey to Svelte + Markdown + Cloudflare Pages
My old blog had been gathering dust for years.
When I finally opened the homepage in 2025, it greeted me with a janky layout shift, a lighthouse score that limped across the finish line, and code so tangled even I—its author—couldn’t remember the wiring.
I suddenly had some free evenings, so I made a promise:
Let’s rebuild this thing, but do it right—and learn something new on the way.
I started where most JavaScript refugees start: Next.js.
It had powered the previous version, so spinning up a fresh repo felt natural… until it didn’t.
That’s when I tripped over Svelte—a framework that compiles your components away, shipping almost no runtime. Articles raved about its performance, and the syntax felt fun. I cloned a demo, ran npm run dev
, and the “aha!” moment landed: tiny bundle, snappy HMR, almost no boilerplate. I was sold.
(Astro flirted with me briefly—zero-JS islands are very appealing—but SvelteKit’s roadmap and ecosystem felt steadier for what I needed.)
Originally, I planned to pair the front-end with Strapi.
The idea: write posts in a nice admin panel, webhook a rebuild.
Two evenings of tinkering later I realised:
So I ditched the CMS. Plain Markdown + YAML front-matter gave me:
mdsvex
, which lets me sprinkle Svelte components right inside Markdown when I need interactivity.I never seriously considered SSR for this project.
Static sites are:
SvelteKit’s adapter-static
made the decision even easier: every route becomes a pre-rendered file, yet I can still opt-in to client-side interactivity where it counts.
My last blog lived on Vercel / Netlify. They’re great!
But I discovered Cloudflare Pages and three things clinched it:
So far, the experience has been smooth: push to main
, watch Pages build and deploy. No horror stories, no surprise throttling.
(If traffic ever explodes, Cloudflare’s free egress should shield my wallet. Fingers crossed.)
CI minutes weren’t the villain here; reproducibility and speed were.
My whole site (pnpm run build
) takes ~5 seconds on my laptop—including the sitemap and image optimisation. Kicking that off locally while writing feels snappier than round-tripping to a cloud pipeline every few minutes.
When the blog stabilises, I’ll wire up GitHub Actions; for rapid-fire edits, local is king.
giscus
.Rebuilding wasn’t just about swapping frameworks—it was about choosing constraints:
For my personal site, SvelteKit + Markdown + Cloudflare Pages nails that balance.
Will I pivot again? Maybe. Technology moves, curiosity wins. But today, this stack feels as clean and lightweight as I hoped—and the page finally loads before I finish my coffee.
Have you tried SvelteKit or Cloudflare Pages for a static blog?