Why I Chose Astro for This Site
Astro's 'ship less JavaScript by default' philosophy turns out to be exactly right for a content site. Here's how I ended up here.
I’ve rebuilt personal sites more times than I care to admit. Gatsby, Next.js, plain HTML, Hugo, back to Next.js. Each time there’s a reason — the previous choice felt too heavy, or too opinionated, or I just wanted to learn something new.
This time I landed on Astro and I think it might actually stick.
The pitch
Astro’s core idea is simple: don’t ship JavaScript you don’t need. For a content-heavy site like a blog, most pages don’t need a runtime. They need HTML and CSS. Astro generates that HTML at build time and only hydrates components where interactivity is explicitly requested.
Coming from React-everything, this felt almost radical. You mean I can just write <article> and have it be a real <article> in the output?
Yes. That’s the whole thing.
Content collections
The feature that really sold me was content collections. You define a schema in TypeScript:
const blog = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/blog' }),
schema: z.object({
title: z.string(),
pubDate: z.coerce.date(),
tags: z.array(z.string()).default([]),
}),
});
And Astro enforces it at build time. Forgot to add a pubDate to a post? Build error. Typo in a tag? You’ll catch it. For someone who’s shipped broken frontmatter to production before, this is worth a lot.
What I like
- Fast builds. Static output means deployment is trivially fast.
- No runtime by default. The site is HTML. Browsers are really good at HTML.
- TypeScript everywhere. The content schema, the components, the pages — all typed.
- Gradual interactivity. When I need a tag filter or a search widget, I can add it without committing to a full SPA.
What to watch out for
The component model takes getting used to. Astro components (.astro files) only render once, on the server. If you want reactivity, you need to either use a framework island (React, Svelte, Vue) or write a <script> block.
For a blog, this is almost never a problem. For a complex app, you’d probably reach for something else — or just drop into a React island where needed.
The verdict
For a content site, Astro is the right call. Fast, simple, TypeScript-first, and it gets out of your way. The framework does less than you’d expect, and that turns out to be exactly what you want.