Markdown front matter
Front matter is a block of metadata at the very top of a Markdown file, written in YAML between two lines of three dashes. Site generators, note apps and converters read it for values such as the title, date and tags, and leave it out of the rendered text. It is a convention, not part of CommonMark, so an app that does not know it shows the block as ordinary text.
---
title: Quarterly planning
date: 2026-11-26
tags: [planning, team]
draft: true
---
# Quarterly planning
The note starts here.
What are the rules for front matter?
- The opening
---must be the first line of the file, with nothing above it, not even a blank line. - The closing line is another
---. Some tools also accept.... - Everything between the two lines must be valid YAML.
- Field names are up to the tool.
title,date,tags,authoranddescriptionare the common ones.
Hugo also accepts TOML front matter between +++ lines and JSON in curly braces, but YAML is the format most tools share.
Which YAML mistakes break front matter?
YAML is strict about a few things that look harmless:
- A colon followed by a space inside a value.
title: Notes: week onefails. Quote it:title: "Notes: week one". - Tabs. YAML indentation must use spaces.
- A value starting with a special character, such as
@,`,[or{, needs quotes unless it is a list or map. - Lists. Write
tags: [planning, team]on one line, or one item per line:
tags:
- planning
- team
When one field is invalid, many tools ignore the whole block or stop the build, so a typo can hide every field at once.
What reads front matter?
| Tool | What it does with front matter |
|---|---|
| Jekyll, Hugo and most static site generators | Use it for page titles, dates, layouts and URLs |
| Obsidian | Shows it as note properties |
| Pandoc | Reads it as document metadata; title, author and date go on the title block |
| GitHub | Shows it as a table above the rendered file |
| VS Code preview | Hides it from the preview |
| CommonMark | Not in the spec, so the block renders as text |
What happens when an app does not support front matter?
A CommonMark renderer sees the first --- as a horizontal rule and the field lines followed by the closing --- as an underlined H2 heading. The result is a line across the top and a heading such as "title: Quarterly planning date: 2026-11-26". If a file looks like that, the app is not reading front matter, and the metadata is safer in the body or removed.
Should notes have front matter?
Only when something reads it. A site generator needs it. A personal note usually does not, because the file name and the first heading already say what it is, and the folder holds the structure. Adding fields "for later" tends to leave them out of date. If you search notes by tag in Obsidian or build a site from them, front matter earns its place.
Front matter in Noteline
Noteline's editor does not treat front matter specially. It shows the block as typed, with the two --- lines drawn as thin rules. In the desktop app, Word and PDF export read the block as metadata: title, author and date print at the top of the document, and other fields are left out of the text. HTML export and printing do not read front matter, so the block appears as a rule and a heading there. The file keeps the YAML as written, so Jekyll, Hugo and Obsidian read it the usual way.
Common questions
Does front matter count toward the word count?
It depends on the app. Many editors count every word in the file, metadata included. Site generators count only the body.
Can front matter go at the bottom of the file?
No. Tools only look at the top. A YAML block anywhere else is ordinary text, and its --- lines become rules or headings.
Is front matter the same as a title heading?
No. A title field is metadata that a tool may print or use for a page title. A # Title heading is part of the visible text. Many files have both.