Why this blog runs on Astro

A static, bilingual, zero-JS-by-default blog that an agent can write into — and why that combination matters.

#astro#seo#i18n

I write in two languages, and I want search engines to treat both versions as first-class citizens. That single requirement rules out most of the quick blog setups I tried.

The problem with client-side language switching

A JavaScript toggle that swaps strings without touching the URL looks fine to a reader and is invisible to a crawler. Google needs separate, crawlable URLs per language — /en/... and /zh/... — plus hreflang annotations so it understands they are translations of the same page rather than duplicates.

Astro’s built-in i18n routing gives me exactly that: every page is generated twice, at two stable paths, at build time.

What this stack gives me

  • Static HTML for every route — fast on Cloudflare Pages, cheap to host.
  • Markdown in the repo — my agent writes src/content/blog/en/x.md and src/content/blog/zh/x.md, and a new bilingual post exists.
  • No client JS by default — only what a page actually needs.
  • Per-language SEO metadata — title, description, canonical and hreflang are generated per page, not swapped at runtime.

Directory convention

src/content/blog/
  en/hello-world.md
  zh/hello-world.md

Same filename, two languages. The build links them automatically, so the language switch button always lands on the translated page instead of the homepage.

Next up: the exact i18n configuration, and the Cloudflare Pages settings that make deployments boring.

This post is also available in 中文

← Back to all posts