Migrating My Blog to Astro and MDX

Migrating My Blog to Astro and MDX

A behind-the-scenes look at how I rebuilt my blog using Astro and static content authoring with MDX.

(Photo by Daniel Seßler (opens in new tab))

For a while, I’ve been wanting to simplify how I author and publish content on my blog. Over time, my previous setup started to feel too dependent on complex tooling and less on what I actually care about: writing and sharing ideas.

Recently, I migrated my blog to Astro (opens in new tab) with content authored in MDX (opens in new tab). In this post, I’ll share the motivations, the process, and what I learned along the way.

Looking Back

Some time ago, I wrote about serving Ghost as a static web application (opens in new tab). At the time, that felt like a good compromise: I could enjoy Ghost’s editor while still deploying a static site.

But over time, even that approach started to feel too cumbersome for my needs. I don’t publish very often, and I don’t plan to monetize my writing or add premium subscriptions. Maintaining Ghost - even in a static setup - was still more overhead than I wanted.

Why Astro?

Astro stood out to me because it’s designed around content-first websites. Blogs, documentation sites, and marketing pages are exactly its sweet spot. Some key reasons I chose Astro:

  • Static-first approach: Pages are pre-rendered by default, which makes them fast and SEO-friendly.
  • MDX integration: I can write Markdown and sprinkle in React (or other frameworks) when I need interactivity.
  • Content collections: Metadata and structure for posts are enforced automatically, keeping things consistent.
  • Great developer experience: Hot reloading, TypeScript support, and a clean project structure.

Just as importantly, the switch meant leaving Ghost behind and embracing a workflow that matched my lighter publishing habits.

Authoring Content with MDX

Instead of relying only on Markdown, I moved to MDX. The main advantage? I can embed components right into my posts.

For example, if I want to add a chart, a custom code block, or even an interactive widget, I can import and render it inline in my content. This gives me the flexibility of a modern JavaScript framework, while still keeping the simplicity of Markdown for most writing.

The Migration Process

The migration was fairly straightforward - and it was even easier when taking advantage of modern AI tooling to help draft blog content, generate scripts, and refine styling. Having that assistance sped up the transition away from Ghost significantly.

The steps were roughly:

  1. Export old posts – I converted existing content into Markdown/MDX format.
  2. Define schemas – With Astro’s content collections, I ensured every post has consistent metadata (title, description, hero image, reading time, etc.).
  3. Set up layouts – I created a blog post layout with Astro components, pulling in metadata and rendering MDX seamlessly.
  4. Polish styling – TailwindCSS made it easy to style the blog while keeping the design clean and lightweight.
  5. Deploy – The blog is now hosted on Cloudflare Workers (opens in new tab), which automatically pulls the latest version from my GitHub repository whenever I push changes.

Early Impressions

It’s still early days since the migration, so I’m holding off on bold claims about performance or workflow improvements. That said, so far I’m enjoying:

  • A lighter setup that matches my publishing needs
  • A simpler writing experience with MDX
  • The flexibility to evolve the blog without the overhead of a CMS

What’s Next

Now that the core migration is complete, I’m planning to experiment with:

  • Adding more interactive MDX components
  • Improving SEO with structured metadata
  • Automating image optimization and responsive hero images

Migrating to Astro and MDX has been a refreshing reset. The site feels lighter, the authoring flow is more straightforward, and I have more control over my content.

Thanks for reading! If you’ve migrated to Astro, MDX, or a similar stack, I’d love to hear your experience - feel free to share it with me.