Skip to content

What it is

Frontmatter is a YAML block at the top of a text file that carries the document's metadata: title, date, tags, author, layout.

Frontmatter sits above the content, separated by a fixed delimiter. In Jekyll, Hugo, Eleventy and Astro, the delimiter is three hyphens:

---
title: Writing a slug
date: 2024-03-15
tags: [web, seo]
---

In TOML-based systems (Hugo's +++) or JSON ({...} at the top), the shape differs but the principle is the same: a machine-readable block that describes what follows. The content below is prose; the frontmatter above is a contract.