Tech

Rebuilding My Static Blog with Astro

cover image

I tore out the blog engine I’d used for years and rebuilt on Astro. The reason was simple — the pages are almost entirely static, but the runtime was far too heavy.

What island architecture changed

Shipping JavaScript only where it’s needed shines especially on photo-heavy posts. Time to first paint dropped noticeably.

The key is that the default is “0KB of JS.” Only components that need interactivity get hoisted as islands with client:* directives; everything else stays pure HTML.

Content collections

Every post is managed as Markdown. Define a schema once, and even a single frontmatter typo gets caught at build time.

const blog = defineCollection({
  loader: glob({ pattern: '**/*.md', base: './src/content/blog' }),
  schema: z.object({
    title: z.string(),
    category: z.enum(['tech', 'travel', 'life']),
  }),
});

The most important thing is not interrupting the flow of writing. Add one file and you’re done.

Keeping builds fast

With just image optimization and caching handled, deploys finish in seconds. A pipeline that lets you keep writing matters more than a perfect setup.

Comments

No login needed — just your name

Searches titles and full text

↑↓ navigate · ↵ open · esc closePagefind