How to add YAML frontmatter to markdown files for metadata like title, date, and tags. Used by static site generators, Obsidian, and Jekyll.
YAML frontmatter is a block of YAML metadata placed at the very top of a markdown file, between two sets of triple dashes (---). It stores structured data about the document — title, date, author, tags, layout — separate from the content. Static site generators like Jekyll, Hugo, and Astro use frontmatter to control page rendering.
The YAML block between --- markers. Everything in this block is metadata, not page content.
Common fields used by blogs and static sites.
| Platform | Supported | Notes |
|---|---|---|
| Obsidian | Yes | Native Properties panel built on frontmatter |
| GitHub | Partial | Rendered as a table, not hidden as metadata |
| Jekyll | Yes | Core feature of Jekyll |
| Hugo | Yes | — |
| Astro | Yes | — |
| Discord | No | Rendered as code block |
Frontmatter in the middle of the file
Frontmatter must be at the very top of the file
YAML frontmatter is only recognized at the start of the document (line 1). It will not be parsed as metadata if placed elsewhere.
--- (TOML +++)
--- (YAML ---)
Hugo also supports TOML (+++) and JSON frontmatter. Make sure you use the right delimiter for your parser.
YAML tags: [markdown, seo] is the inline array format. You can also use block format: tags: - markdown - seo
Use ISO 8601 date format (YYYY-MM-DD) for maximum compatibility across static site generators.
Everything you need to know.
Frontmatter is a block of YAML metadata at the top of a markdown file, between --- delimiters. It stores structured data like title, date, and tags that processors use to generate pages, feeds, and metadata.
Markdown doesn't have its own comment syntax. To add hidden comments that won't appear in the rendered output, use HTML comments (<!-- -->). These are useful for notes to collaborators, TODOs, and temporary content.
Markdown headings are created with hash symbols (#). One hash for H1 (largest), two for H2, up to six for H6 (smallest). Headings structure your document and create a hierarchy that readers and search engines can follow.
Most markdown parsers allow you to embed raw HTML directly in your markdown file. HTML blocks let you use elements not supported by markdown — custom divs, details/summary, colored text, form elements, and more. HTML support depends on the platform — some sanitize or strip it entirely.
Paste your markdown and see yaml frontmatter rendered instantly with professional themes.