Skip to content
uencoder

YAML Frontmatter

YAML frontmatter is the --- delimited YAML block at the top of a Markdown file that stores document metadata (title, date, tags).

Purpose

To embed structured metadata in Markdown documents so static site generators (Hugo, Jekyll) can extract page properties.

Mechanism

The file starts with --- opening a YAML block, a second --- closes it, and the Markdown body follows. The parser separates the YAML metadata from the Markdown content, and the metadata is parsed into an object.

Use cases

  • Static site generators
  • Blog post metadata
  • Documentation sites

Related tools

References