Front matter is a metadata block at the top of a content file that describes the page to a static site generator. It typically contains fields such as title, description, date, tags, draft status, and template information.

Common front matter formats

Most static site generators support YAML front matter, and some also support TOML or JSON.

---
title: "Notes on Static Site Generators"
description: "A short summary used in metadata and previews."
date: 2026-10-16T09:00:00Z
draft: false
tags:
 - static-sites
 - tooling
---

The metadata sits between delimiters at the top of the file. The Markdown body follows below it.

What front matter controls

FieldCommon useBuild impact
titlePage title and headingMissing titles can break templates or listings
dateSorting and publishing metadataInvalid dates can cause build errors
draftDraft/published stateDrafts may be excluded from production builds
tagsTaxonomy pages and filtersInvalid structure can break taxonomy generation
slugURL path overrideCan change canonical URLs
descriptionMetadata and previewsAffects snippets and social previews

Common mistakes

Front matter errors are a frequent cause of static site build failures. Common problems include invalid YAML indentation, incorrect date formats, missing quotes around special characters, and inconsistent field names across files.

A Git based CMS can reduce these errors by exposing front matter as form fields and validating values before saving. Even with a visual editor, keep the underlying front matter format consistent across your content repository.

For related reading, see What Is Markdown? and The LightCMS Editor Tour.