Front matter is a block of YAML at the very top of a Markdown file, opened and closed by a line of three dashes (---). Static site generators read it as the page's data, such as title, date, layout and tags, then render everything below the closing line as the page content.
| Generator | Formats | Fields it reads itself |
|---|---|---|
| Jekyll | YAML between --- | layout, permalink, published; on posts: date, category, categories, tags |
| Hugo | YAML (---), TOML (+++), JSON ({ }) | title, date, draft, description, slug, weight, tags |
| Eleventy | YAML by default, plus ---json and ---js | permalink, layout, tags |
| Astro | YAML or TOML | layout (for Markdown pages in src/pages) |
Updated
Front matter turns a plain Markdown file into a page with metadata, and a single misplaced dash breaks it. Paste a file into the splitter to see exactly where the metadata ends and the content starts, and which top-level fields it found, before your build complains.
Paste a Markdown file. The splitter finds the front matter block, lists its simple top-level fields and shows the body that will be rendered.
Front matter found and closed.
A typical post: quoted title because it contains a colon, a date, a list of tags and a custom author field.
---
title: "Sourdough: a beginner's starter"
description: Feed it daily for a week before baking.
date: 2026-10-20
tags:
- baking
- guides
author: Ana Ruiz
---
Mix equal weights of flour and water in a clean jar...Hugo reads +++ as TOML front matter. Custom values sit under the params key.
+++
title = "Sourdough: a beginner's starter"
date = 2026-10-20
draft = false
tags = ["baking", "guides"]
[params]
author = "Ana Ruiz"
+++
Mix equal weights of flour and water in a clean jar...
Jekyll's documentation puts it plainly: front matter must be the first thing in the file and must be valid YAML set between triple-dashed lines. Other generators follow the same shape.
Inside the block, normal YAML applies. Indent with spaces, quote values with special characters and use lists for tags and categories.
A title and a description cover the page heading and the search snippet in most themes. A date orders posts, and draft or published decides whether the page is built at all.
Everything else is up to your templates. Any field you add becomes data the layout can print, such as an author name, a hero image path or a reading time.
It is metadata written at the top of a Markdown file between two delimiter lines. Markdown itself does not define it; static site generators and content tools agreed on the convention and read it as data before rendering the rest.
YAML is the common default, but not the only option. Hugo accepts TOML between +++ lines and JSON in braces, Eleventy supports ---json and ---js, and Astro accepts TOML as well.
Usually something sits before the first ---, the closing --- is missing, or the opening line has extra characters. The splitter above flags the last two straight away.
Yes. In Jekyll an empty pair of --- lines still marks the file for processing, which is how CSS or feed files get Liquid tags rendered without any metadata.
Split the file at the delimiters, parse the first part with a YAML library and pass the rest to your Markdown renderer. Eleventy does this with the gray-matter package, which you can also use directly in Node.
Related: Markdown cheat sheet, Static site generators, YAML comments, TOML vs YAML, Markdown to HTML.
Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.
We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.