# Front Matter

> A block of settings at the top of a file, between two lines of dashes. It holds the title, date and tags.

**Field:** Software Development  
**Category:** Files & Formats  
**Also known as:** YAML Front Matter, Frontmatter

## Think of it like

Think of it like the sticky note on top of a homework sheet. It holds the name and date, not the answers.

## Definition

Front matter is a small block of settings at the very top of a text file. It sits between two lines of three dashes. Inside, it is usually written in YAML, as names and values. It holds facts about the file, like its title, date or tags. Site builders and note apps read it, and the rest of the file is the content. It is most common in Markdown files.

## Example

Lucy writes a blog post in Markdown. Its front matter gives the title and the date, and her site builder puts both on the page.

## Example code

```markdown
---
title: My First Post
date: 2026-03-07
tags: [travel, food]
---

# My First Post
```

The lines between the two sets of dashes are settings. The page itself starts below them.

## Why it matters

It keeps the facts about a page in the same file as the page. Nothing gets lost in a separate list.

## Common mistake

Putting a blank line or any text above the first three dashes. The front matter must be the very first thing in the file.

## Three principles

- **Top of the file.** It must come before anything else.
- **Between dashes.** Three dashes open it and close it.
- **Facts, not content.** The title, date and tags live here.

## Related terms

- [Markdown](https://learn.benibix.com/term/development/markdown)
- [YAML Ain't Markup Language (YAML)](https://learn.benibix.com/term/development/yaml)
- [Configuration File](https://learn.benibix.com/term/development/config-file)
- [Static Site Generation (SSG)](https://learn.benibix.com/term/development/static-site-generation)
- [Metadata](https://learn.benibix.com/term/data/metadata)

## Taught in

- [Markdown and Front Matter](https://learn.benibix.com/learn/development-formats/markdown-and-front-matter): File Formats, 7/11

![A file called my-first-post.md. Its top part, lit up, sits between two lines of three dashes and holds a title, a date and tags. Below it come a heading and a line of text. An arrow from the top part leads to a box that says the site builder reads it for the page title, the date and tag links. An arrow from the rest leads to a box called the content.](https://learn.benibix.com/diagrams/dev2-front-matter.svg)

---

Source: https://learn.benibix.com/term/development/front-matter
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
