How I got here
Before settling on Markdown I tried the usual suspects for this blog: a WYSIWYG editor, a headless CMS, and, for a while, posts stored as JSON. All of them worked. None of them felt like writing.
Markdown is what stuck, and this post is about why: how the posts are stored, how they get rendered, and the JSON experiment that convinced me.
The JSON phase
My first version described every post as a list of blocks:
[
{ "type": "h2", "text": "Introduction" },
{ "type": "p", "text": "This post will cover..." },
{ "type": "code", "language": "js", "text": "const x = 42;" }
]
It looks tidy for three blocks. By the third post it was a mess. Every post needed a slightly different block type (a quote, a list inside a list, a table), each one meant another case in a custom renderer, and writing a paragraph meant escaping quotes inside a JSON string. I was spending more time on the format than on the posts.
Switching to Markdown made all of that go away. I write the post, a parser turns it into HTML, and nobody has to invent a new block type for a table.
Why it works for me
It reads like text. A heading is a #, a list is a -, code goes between backticks. Writing a post feels like writing a long, well-formatted message, not filling in a form.
It lives in Git. Each post is a file in the repo with its content in a Markdown string. That means history for every edit, pull requests when I want someone to review a post, and no external service that can go down or change its pricing.
The structure is the content. With JSON, the structure was something I had to maintain separately. With Markdown, it's just how the text is written.
I write where I already work. The whole site is code, so writing a post in the same editor, committing and deploying is the shortest path. No admin panel, no plugins.
What a post looks like
A post is an object with some metadata and the body as Markdown:
{
slug: 'my-first-post',
title: 'My first post',
date: 'June 15, 2025',
excerpt: 'A short summary for lists and share cards.',
content: `## Hello\nThis is **Markdown**...`,
author: 'Sebastian Alvarez',
tags: ['Markdown', 'Blogging'],
}
When I first wrote this post I rendered content with marked and dangerouslySetInnerHTML. It worked, but injecting HTML like that is asking for trouble the day some content isn't fully under your control. Today the body is rendered on the server with react-markdown, and every post goes through a sanitizer before it reaches the page:
<ReactMarkdown
remarkPlugins={[remarkGfm]}
rehypePlugins={[rehypeRaw, rehypeSanitize, rehypeHighlight]}
>
{post.content}
</ReactMarkdown>
remark-gfm adds tables and task lists, rehype-sanitize strips anything that shouldn't be there (scripts, iframes), and rehype-highlight colors the code. Since it all runs on the server, none of these libraries ship to the reader's browser.
Making it look good
For styles I use Tailwind's @tailwindcss/typography. Wrapping the content in a prose class gives sensible defaults for headings, paragraphs, lists, code and tables, and modifiers let me adjust just the pieces I care about:
<div class="prose prose-headings:tracking-tight prose-a:text-primary prose-pre:bg-muted">
The nice side effect is the separation: Markdown decides the structure, the stylesheet decides how it looks, and I can't break the layout by writing a post.
Would I recommend it?
For a developer writing their own blog, yes. It's fast to write, lives next to the code, renders the same way everywhere, and if I ever move the site to another stack, the posts come with me as plain text.
Where I'd think twice: if people who don't use Git need to write and publish, a CMS will make them happier. For a site like this one, Markdown in the repo is the simplest thing that works, and it has kept working.
What did you think?
Found this article helpful? Share it!
Help others discover this content by sharing it on your favorite platform.



