Hatchet Labs · projects · notes · about
It's Frontmatter but at the back of the file.
2026-11-11 · spec · markdown, metadata
Backmatter is Frontmatter at the back of the file. Frontmatter is a YAML block between lines of three hyphens at the start of a document. Backmatter is the same block at the end. A parser reads both blocks and combines their root keys. When keys collide, Frontmatter wins.
The point is order. Some metadata is only known once the writing is done, some metadata is longer than the plain text body!, and some metadata is a spoiler the text that is about to come. Backmatter allows you to put the body first.
The writing comes first.
---
title: "When Backmatter matters"
tags: ["Backmatter", "Frontmatter"]
---
A renderer that only knows how to parse Frontmatter shows the block as plain Markdown, so the file is readable with or without explicit Backmatter support.
The reference parser is on npm: @hatchetlabs/backmatter. The js reads each block with gray-matter and combines the root keys.
const backmatter = require('@hatchetlabs/backmatter');
backmatter('The writing comes first.\n\n---\ntitle: any metadata\n---\n');
// { data: { title: 'any metadata' }, content: 'The writing comes first.\n\n', backmatter: true }
The repository holds the spec, the parsers, working examples and a skill, under the MIT license.