Building a Static Blog That's Actually Good for SEO

Search engines rank pages, not sections of a page. That single fact decides how a blog should be wired into a site — and it happens to resolve the usual tension between "I want more content for SEO" and "I don't want my homepage to get longer."

The answer is the same for both: give every post its own URL.

Why separate URLs win

When you inline a blog onto your homepage, every post's keywords compete inside one URL. Google has nothing to rank but that single page. Move each post to its own address — /blog/<slug>/ — and you get one indexable surface per article, each free to target its own long-tail query.

The homepage stays short. The blog grows wide. Those are no longer in conflict.

What each post needs

Hand-writing the metadata for every post is tedious and error-prone, so we generate it at build time from Markdown front matter:

  • A unique <title> and meta description
  • A canonical link pointing at itself
  • hreflang alternates for the other language
  • BlogPosting and BreadcrumbList structured data (JSON-LD)

Here's the front matter that drives it all:

YAML
title: "Building a Static Blog That's Actually Good for SEO"
description: "How we added a Markdown-driven blog..."
date: 2026-06-19
tags: [SEO, Web Development]
slug: static-blog-seo

The build step

A small Node script reads content/blog/**/*.md, renders the body with marked, wraps it in a shared template, and writes static HTML straight into dist/. No runtime JavaScript, no framework — just fast, crawlable pages that Cloudflare serves from the edge.

  1. Parse front matter and Markdown
  2. Inject per-post SEO metadata and JSON-LD
  3. Regenerate the sitemap and an RSS feed
  4. Drop the three newest posts onto the homepage as teaser cards

That last step is the trick that keeps the homepage fresh without making it longer: a fixed three-card slot, auto-filled at build time.

This very post was written in Markdown and rendered by that same pipeline — the setup carries its own weight. Every post after it is just another Markdown file: write it, run the build, and a new indexable page ships itself.

About this post

AI-generated content
Yes (Model: Claude Opus 4.8)
AI-proofread content
No
AI-translated content
No
Share