Writing Long-Form Posts with Chapters
A technical post is closer to a short book than to a status update. Readers skim the outline first, jump to the part they need, and come back later to find one detail. Chapter is built around that: the headings of a post are its outline, and the outline stays next to the text while you read.
Headings become chapters
Every ## heading is a chapter. Chapters are numbered in the text (the 01, 02 you see above each one) and listed with the same numbers in the right column.
## Headings become chapters
### Subsections
## The table of contents### headings are subsections. They show up in the table of contents under their chapter, but they are not numbered. Deeper levels (####) stay out of the table of contents.
Write headings that stand alone
A reader scanning the table of contents sees only the headings. “Setup” says less than “Install the CLI”; “Results” says less than “Cold starts dropped by 40%”. If the outline reads like a summary, you have good headings.
Keep chapters even
Aim for chapters of similar length. A post with one huge chapter and five tiny ones has an outline that does not help anyone find anything.
The table of contents
From 1024px wide, the table of contents sits in the right column and follows you down the page:
- The current chapter is highlighted as you scroll.
- Chapters you have finished get a check mark.
- The counter at the top shows where you are, for example
3 / 6. - The bar under the counter shows how much of the post you have read.
On narrower screens the table of contents collapses into a bar under the header that shows the current chapter. Tap it to open the full list.
Posts with fewer than two chapters do not show a table of contents. A short note does not need one.
The byline
The line under the title is generated from the post:
| Field | Source |
|---|---|
| Date | pubDate in the frontmatter |
| Updated | updatedDate, shown when it differs from pubDate |
| Reading time | Word count; CJK characters are counted one by one |
| Chapters | The number of ## headings, from two upwards |
Series
A series is a group of posts that build on each other. To start one, add a tag to SITE_SERIES in src/config/site.ts and give each post in the series that tag. Posts are ordered by publish date.
This post is part 3 of the Getting-Started series: the box under the title lists every part, with the current one in bold. On the home page, the newest post shows its series beside it in the same way.
If a post carries two series tags, the one listed first in SITE_SERIES wins.
Drafts
Add isDraft: true to the frontmatter to keep a post out of the published site:
---title: 'Half-finished thoughts'pubDate: 'December 1 2026'isDraft: true---Drafts show up while you run pnpm dev, so you can preview them, and are left out of pnpm build: no page, no RSS item, no sitemap entry.
Frontmatter reference
| Field | Required | Notes |
|---|---|---|
title |
Yes | |
description |
Yes | Shown in lists, search and link previews |
pubDate |
Yes | Any format Date can parse, e.g. 'November 15 2026' |
updatedDate |
No | |
heroImage |
No | Path under public/, e.g. '/covers/post.webp' |
category |
Yes | One of the categories in ARCHIVE_THEMES |
tags |
Yes | One to three tags from ALLOWED_TAGS |
isDraft |
No | Defaults to false |