Building a Markdown Blog With Zero Dependencies
How this blog turns plain markdown files into a static site with a tiny Node script — no frameworks required.
This site is a single hand-written HTML page deployed to Netlify. When I wanted to add a blog, reaching for a whole static-site generator felt like bringing a forklift to carry a coffee cup. So I wrote a small build script instead.
The goals
- Write posts in plain markdown
- No runtime dependencies to install or keep updated
- Match the look of the rest of the site
- Rebuild automatically when I push
The approach
A single build.js file reads every markdown file in posts/, parses a small frontmatter block for metadata, converts the body to HTML, and writes out a listing page plus one page per post.
node build.js
# → Built 2 post(s) → blog/
Netlify runs that command on every deploy, so publishing a new post is just:
- Add a markdown file to
posts/ - Commit and push
Frontmatter
Each post starts with a little metadata block:
---
title: My Post
date: 2026-07-18
description: A one-line summary.
---
The parser is intentionally boring — a handful of regular expressions covering headings, lists, links, blockquotes, and fenced code blocks. It covers everything I actually use when writing, and when it doesn't, it's fifty lines of code I fully understand.
Why not a framework?
Frameworks are great when the problem is big. This one isn't. Owning the whole pipeline means there's nothing to break during an upgrade, nothing to audit for security, and the entire blog engine fits in one file I can read in a sitting.
Sometimes the right amount of tooling is almost none.