Markdown blog post template with front matter
Make your blog-post.md
The whole file is here. Edit it, then copy it or save it. Nothing is sent anywhere.
---
title: "The title, written as the thing a reader would search for"
description: "One sentence, under 160 characters, that makes the click worth it."
date: 2026-08-01
tags: [engineering, performance]
draft: true
---
# The title, written as the thing a reader would search for
Open with the answer, not the throat-clearing. If someone reads only the first
two sentences, they should already have the thing they came for. The rest of
the post earns their attention by explaining why it is true.
## The problem
Describe the situation concretely enough that the right reader recognizes
themselves in it. Numbers help: *"the page took 4.1 seconds to render on a mid
range Android"* lands harder than *"the page was slow"*.
## What I tried first
The failed attempt is usually the most useful part of the post, because it is
the one your reader is about to try. Say what you expected, what happened, and
why the two differed.
```js
// The obvious approach, and why it was not enough.
const result = items.map(expensive).filter(Boolean);
```
## What actually worked
```js
// The version that shipped.
const result = [];
for (const item of items) {
const value = expensive(item);
if (value) result.push(value);
}
```
Explain the mechanism. A reader who understands *why* can apply it to a problem
that is not quite yours; a reader who only has the snippet cannot.
## Results
| Metric | Before | After |
| :--- | ---: | ---: |
| Render time | 4.1 s | 1.6 s |
| Bundle size | 480 KB | 190 KB |
## What I would do differently
Short, honest, and specific. This is the section people quote.
---
*Questions or corrections: [email@example.com](mailto:email@example.com).*
Visual
A post structure that survives contact with an actual reader: most of whom arrived from a search, want one specific thing, and will leave the moment they suspect you are going to make them work for it.
Front matter first
The block between the triple dashes is metadata, not content:
---
title: "The title, written as the thing a reader would search for"
description: "One sentence, under 160 characters, that earns the click."
date: 2026-08-01
tags: [engineering, performance]
draft: true
---
Your generator reads it and strips it. draft: true is worth keeping in the
template: it is a one-word switch that stops a half-finished post publishing
itself, and it is easy to forget to add later.
Watch the colons. A title containing : breaks the parse unless it is quoted,
which is why every string value here is in quotes.
Open with the answer
The instinct is to build to the conclusion. The reader’s instinct is to leave before you arrive. Put the finding in the first two sentences and spend the rest of the post justifying it: you lose nothing, because the people who want the reasoning keep reading, and you keep the people who only wanted the answer.
The failed attempt is the valuable part
The section most often cut is “what I tried first”, and it is the one most worth keeping: your reader is usually about to try exactly that. Say what you expected, what happened instead, and why the two differed.
Show the numbers
| Metric | Before | After |
|---|---|---|
| Render time | 4.1 s | 1.6 s |
| Bundle size | 480 KB | 190 KB |
Right-align numeric columns so the digits line up and the comparison is visible without reading. Two rows of real measurements do more for credibility than any amount of adjective.
Close with what you would change
Short, specific, and honest about the limits of what you did. It is disproportionately the section people quote when they share the post, and the one that makes the difference between a write-up and an advert.
Common questions
- What is the block at the top between the three dashes?
- YAML front matter: metadata for whatever builds your site, not part of the post. Static site generators read the title, date and tags from it and never render it. The editor here hides it in the preview and marks it with a small note, so you can see it is being recognized.
- Which front matter fields do I actually need?
- Almost always title and date; usually description and tags; sometimes draft. The exact set depends on your generator (Hugo, Astro, Jekyll and Eleventy each define their own) so check its docs before adding fields it will ignore.
- Should the post start with an H1 if the title is already in the front matter?
- Usually not. Most generators render the front matter title as the page's H1, so a second one in the body gives you two, which is a real accessibility and SEO problem. This template includes it for drafting; delete it if your layout supplies one.
- Why open with the conclusion?
- Because that is the order people read in. Most visitors arrived from a search with a specific question, and a paragraph of context before the answer reads as an obstacle. The reasoning still gets read: by the people who wanted it, after they have the answer.
- How do I write the code examples?
- Fenced blocks with the language named after the opening backticks, which is what turns on syntax highlighting. Keep them short enough to read on a phone: about ten lines and sixty characters wide before horizontal scrolling starts.
- Can I preview it before it goes into my site?
- Yes, and it is worth doing. Paste the draft into the editor here and the preview renders it the way a Markdown-based generator will, front matter and all, without running a build.
Sources
- Jekyll docs: front matterthe block at the top, and what generators read from it