Skip to main content

Frontmatter

A block of structured metadata placed at the very top of a Markdown file, delimited by triple dashes (---). Almost always written in YAML, though some systems accept TOML or JSON. Frontmatter lets a plain-text file carry its own metadata without polluting the content: title, author, date, tags, description, custom fields—whatever the system needs to know about the document that isn't in the document.

If Markdown is a filing cabinet, frontmatter is the label on the folder. It tells you what's inside before you open it, and it tells machines what's inside without parsing the prose. Static site generators (Jekyll, Hugo, Docusaurus), content management systems, and documentation pipelines all lean on frontmatter to organize, sort, filter, and render content. Without it, a Markdown file is just text. With it, it's a structured knowledge object.

Why it matters for writers: Frontmatter is one of the few places where writers directly control how machines interpret their content. Well-structured frontmatter improves search, retrieval, and organization; sloppy or missing frontmatter means your documents are invisible to any system that relies on metadata. In RAG pipelines, frontmatter fields can inform chunking strategies, embedding context, and metadata filtering—turning what looks like a formatting convention into a real lever for retrieval quality.

Related terms: Schema · Metadata Filtering · Context Generation