Next.js Markdown blog → Astro Content Layer
mediumAstro is purpose-built for content sites. Zero JS by default, island architecture, and Content Collections with type safety beat Next.js for blogs.
npm create astro@latest && cd my-astro-site
Define schema in src/content/config.ts. Collections auto-validate frontmatter.
import { defineCollection, z } from 'astro:content'
const blog = defineCollection({ schema: z.object({ title: z.string(), date: z.date() }) })
export const collections = { blog }Copy markdown files to src/content/blog/. Frontmatter is validated against the schema.
src/pages/blog/[slug].astro uses getStaticPaths() with getCollection('blog').
const posts = await getCollection('blog')
return posts.map(post => ({ params: { slug: post.slug }, props: post }))Use Astro's built-in Image component. Add @astrojs/image integration.
import { Image } from 'astro:assets'React components still work with client:load or client:visible. No need to rewrite interactive parts.
What this migration involves
Moving from Next.js Markdown blog to Astro Content Layer is rated medium and takes about 3-6h on a typical project. The guide breaks it into 6 steps, 4 of which ship with runnable commands and 1 with a verification check.
Related migrations
FAQ
How long does migrating from Next.js Markdown blog to Astro Content Layer take?
Around 3-6h for a typical project — 6 steps, difficulty rated medium, 4 of them with copy-paste commands.
Is moving from Next.js Markdown blog to Astro Content Layer reversible?
No reverse guide is tracked yet, so treat this as a one-way move and keep a full export of your Next.js Markdown blog data before you start.
What does Astro Content Layer cost compared to Next.js Markdown blog?
Pricing for both tools is contact-based or not tracked yet.