frontmatter

In the context of .md (Markdown) files, frontmatter is a block of metadata placed at the very beginning of the file. It’s often used by static site generators like Jekyll, Hugo, or Eleventy to configure settings or define variables for the Markdown content that follows.

Format

Frontmatter is typically written in YAML and enclosed between triple dashes (---) like this:

---
title: "My Awesome Post"
date: 2025-05-31
author: "Mason Young"
tags: ["markdown", "frontmatter", "static site"]
draft: false
---

# My Awesome Post

Here’s the main content of the markdown file.

Common Uses

  • title: Title of the post or document
  • date: Date of publication or creation
  • tags or categories: To organize or filter content
  • layout: Which template to use (common in Jekyll)
  • draft: Marks a post as a draft (common in Hugo)

Why It Matters

Static site generators and markdown parsers use frontmatter to:

  • Control how the file is rendered
  • Pass metadata to templates
  • Organize content programmatically

this page was seeded with info via ChatGPT


home
created: 2025-05-31