YAML front matter

What it is

Static site generators (Hugo, Jekyll, Astro) and note apps (Obsidian) share a convention: a file may begin with a block of YAML fenced by ---, holding metadata such as title, date, and tags.

---
title: Post title
date: 2026-08-12
tags: [markdown, editor]
draft: false
---

The body starts here.

There are only two rules, and neither can be bent:

  1. The opening --- must be on the very first line — not even a blank line before it.
  2. Another line of --- closes the block.

Why it needs special handling

Plain Markdown knows nothing about front matter. Feed the block above to an ordinary parser and you get: the first --- becomes a horizontal rule, title: Post title becomes body text, and the closing --- becomes another rule — in other words, a mess.

This editor lifts the front matter out first and renders it as a card labeled YAML Front Matter; only the remaining body goes to the Markdown parser. So the preview shows:

YAML Front Matter A boxed block that displays your fields exactly as you wrote them.

The first heading of your body stays the first heading of your body.

What the editor does not do

That is deliberate: the editor's contract is don't break your file. What the fields mean is the generator's business.

Try it

This page is itself an example. Download it as .md with the link below, open it in the editor, and the title and order lines at the top appear as a card.

Download this page as .md Open it in the editor and you have a ready-made sample document.

← Back to the manual