What it is for
Frontmatter is for the tools that use the file, not for the person reading it.
- Static site generators such as Jekyll, Hugo, Astro and Eleventy read the title, date and layout to build each web page.
- Note apps such as Obsidian show it as the note's properties, and use the tags to find notes.
- Documentation tools read a title, a sidebar position or a description for search results.
- AI tools read it at the top of instruction files and skills, to decide when the file applies.
The guides on this site are written this way: each one starts with a title, a description and its place in the list.
How to write YAML frontmatter
- The first line of the file is
---, with nothing before it, not even an empty line. - Each setting is a name, a colon, a space and a value.
- The block ends with another
---.
| Value | Write |
|---|---|
| Text | title: Trip notes |
| Text with a colon | title: "Rome: day one" |
| A date | date: 2026-03-14 |
| Yes or no | draft: true |
| A list | tags: [travel, italy] |
A longer list can go one item per line:
tags:
- travel
- italy
TOML frontmatter
Hugo also accepts TOML, between lines of +++, with = instead of a colon.
You write
+++
title = "Trip notes"
draft = true
+++
The page starts here.You see
The page starts here.
Which settings to use
There is no standard list. Each tool reads its own names, so check the
documentation of the tool that will use the file. title, date,
description and tags are the most common.
How apps show it
| App | Frontmatter |
|---|---|
| GitHub | Shown as a small table at the top |
| MarkdownPaper | Hidden, YAML and TOML |
| Obsidian | Shown as properties |
| Static sites | Used to build the page, not shown |
Common problems
- The block shows as a line and a heading. Something is before the first
---, often an empty line. The block must be the very first thing in the file. - A tool cannot read the title. A value with a colon in it needs quotes.
- Tabs in the block. YAML only accepts spaces for indenting.
Questions
What is the --- at the top of a Markdown file?
It opens the frontmatter, a block of settings in YAML that ends at the next
---.
Is frontmatter part of Markdown?
No. It is a convention that most Markdown tools agree on. Apps that do not know it show it as text, usually as a line with a heading under it.
Is frontmatter required?
No. A Markdown file without it is perfectly fine. Add it only when a tool needs it.
Next
- GitHub Flavored Markdown, the version of Markdown most tools follow.
- Open a Markdown file and read it without the settings block.