Use Markdown in Astro content collections when developers write the posts. Use a CMS like Sanity when anyone else does. I use a hybrid: I draft in Markdown and a script imports each post into Sanity.
Use Markdown files in Astro's content collections when the people writing are comfortable with code and Git. Use a CMS like Sanity when anyone else writes, edits or approves posts. Both produce the same fast static pages. The difference is entirely about who edits and how.
I use a bit of both. I draft my posts as Markdown files, and a script imports each one into Sanity, where the site reads it. More on that below.
What a Markdown blog in Astro looks like
Astro has content collections built in. You put posts in a folder as `.md` or `.mdx` files, each with a short header of details like title, date and description. A schema checks those details at build time, so a post with a missing title fails the build instead of going live broken.
Astro's `glob()` loader reads Markdown, MDX, Markdoc, JSON, YAML and TOML files. The docs say build-time collections are suitable for tens of thousands of entries.
To publish, you add a file and deploy.
What a CMS blog in Astro looks like
With a headless CMS, posts live in a hosted service. Writers log in to an editor, fill in fields and press Publish. Astro fetches the posts during the build. Astro's docs list dozens of CMS guides, and I compare the main ones in the best CMS for Astro in 2027.
On my site, the CMS is Sanity and its editor lives at /admin.
Side by side
Who can edit
- Markdown: developers, or writers comfortable with a code editor and Git.
- CMS: anyone with a login.
This is the deciding factor nine times out of ten.
Images
- Markdown: images live in the project. Astro optimises local images, but someone has to add files to the right folder.
- CMS: writers upload images in the editor. Sanity serves resized, modern formats from its image service, and supports a hotspot so crops stay on the subject.
Preview
- Markdown: run the site locally, or use your host's preview deploys.
- CMS: depends on setup. Sanity's Presentation tool can show the live page beside the editor, but it needs development work.
Validation
- Markdown: schema checks at build time.
- CMS: checks in the editor as you type. In Sanity I add warnings when an SEO title passes 70 characters or a description passes 170.
Version history
- Markdown: full history in Git, with every change and who made it.
- CMS: Sanity keeps document history too, in the editor.
Cost
- Markdown: free.
- CMS: Sanity's free plan covers most small teams, and Growth is $15 per seat a month, checked December 2026.
Reuse
- Markdown: content lives in one project.
- CMS: the same content can feed several sites, an app or a newsletter through the API.

When Markdown is the right choice
- A developer's own blog or a documentation site.
- Engineering teams who already review everything in Git.
- Very small sites that rarely publish.
- No budget for any service, ever.
When a CMS is the right choice
- Anyone non-technical writes, edits or approves posts.
- Posts link to other content, such as authors, projects or services.
- You want scheduling, roles or in-editor checks.
- You'll reuse content beyond the website.
For a business blog, that's almost always a CMS.
My hybrid workflow
My blog has more than 80 posts. Here's how they get there:
- Draft in Markdown. Each post is a file with a header for slug, title, SEO title, SEO description and excerpt, plus the body.
- Check. A script runs a dry check: lengths, no banned punctuation, and every internal link points to a real page.
- Figures. A separate file lists each post's charts and screenshots, with alt text and the heading they belong under. A script renders the charts as images.
- Import. The same script converts the Markdown into Sanity's rich text, uploads the images, links the author and publishes the post.
- Build and deploy. Astro builds the pages from Sanity.
Why not just Markdown? Because Sanity gives the site structure I'd otherwise rebuild: authors as documents, related projects, SEO fields, share images. And if someone else ever writes for the blog, they can do it in Studio without touching files.
Why not just Sanity? Because I write in bulk, and Markdown files are quick to write, check and keep in one place.
Most businesses don't need this. It's a workflow for someone who writes and builds.

Moving from one to the other
- Markdown to CMS: a script reads each file and creates a document. That's exactly what my import does.
- CMS to Markdown: export the content as JSON and convert it. Sanity's content can be exported and imported in full.
Neither choice locks you in, which is one of the nice things about Astro.
Common mistakes with each
With Markdown:
- Letting the header fields drift, so some posts have a description and others don't. A schema in the collection config stops that.
- Dropping large images straight into the project without resizing.
- Asking a non-technical colleague to "just edit the file on GitHub". It rarely ends well.
With a CMS:
- Giving writers one giant rich text field and no structure, which recreates the mess the CMS was meant to fix.
- Skipping help text and validation, so SEO fields are left empty.
- Forgetting the rebuild, so a published post doesn't appear on a static site until someone deploys.

A decision checklist
- Will anyone non-technical touch the blog? CMS.
- Do posts reference authors, projects or products? CMS.
- Is the writer a developer who lives in Git? Markdown.
- Is the budget exactly zero, with a developer writing? Markdown.
- Unsure? Start with a CMS on its free plan.
For the rest of the setup, see the best Astro stack for a small business.
Frequently asked questions
Is a Markdown blog better for SEO?
No. Both output the same HTML. SEO depends on what you put in the page, not where the content is stored.
Can Astro handle hundreds of Markdown posts?
Yes. Astro's docs say build-time collections suit tens of thousands of entries.
Can I use MDX for components in posts?
Yes, Astro supports MDX. Be careful: posts full of components are harder to move later.
Which CMS works best with Astro?
For most small businesses I use Sanity. Keystatic and Decap are free, Git-based options that store content as files.
Sources
- Astro Docs, Content collections
- Astro Docs, Use a CMS with Astro
- Sanity Docs, Presentation tool
- Sanity Docs, Import data
- Sanity, Pricing, checked December 2026
Not sure which suits your team? Book a free call and we'll work it out.





