Frontmatter (YAML/TOML/JSON) Leitfaden
Referenz für frontmatter metadata blocks verwendet in Markdown und static site generators.
Format Variants
YAML frontmatter is delimited by --- lines and is the most common format. TOML frontmatter uses +++ delimiters and offers stricter typing. JSON frontmatter uses curly braces and is fully standardized. The frontmatter block appears at the top of a content file, before the body. Static site generators parse frontmatter to extract metadata like title, date, and tags.
- YAML
- --- delimited
- TOML
- +++ delimited
- JSON
- Brace delimited
most common stricter typing fully standard Parsing and Usage
Frontmatter parsers split the file at the delimiter and parse the metadata block separately. Common fields include title, date, tags, categories, draft status, and custom metadata. Astro, Hugo, Jekyll, and Next.js all support frontmatter. The metadata is available in templates and for content queries. Invalid frontmatter causes build failures, so validation is important.
- parsing
- Split and parse metadata
- common fields
- title, date, tags
- SSG support
- Astro, Hugo, Jekyll
before body draft, layout Next.js, Gatsby