Building a Blog Platform with Docker #3: Markdown Rendering
Quick one-liner: Stop writing HTML for your posts. Parse .md files with YAML frontmatter and render them in Flask.
Why This Matters
Last time you built a blog that looks like a blog. Teal nav, dark background, editorial post list. Nice.
But the post in that list? It's hardcoded HTML. Every time you want a new post, you have to edit a template. That's not a blog platform, that's a website.
A real blog platform lets you write a file, drop it in a folder, and have it appear. That's what Markdown gives you.
Why Markdown?
You write in plain text: no <p> tags, no & , no forgetting to close a <div>
It's readable as-is, even before rendering
Every major writing tool supports it
Easy to version control in git
By the end of this post, you'll be able to drop a .md file into a folder and have Flask render it as a proper HTML page.
Starting Point
You should have this from last time:
tiohub-blog/ βββ app.py βββ static/ β βββ js/ β ββββ¦