Frontmatter is a type of structured data that is defined at the beginning of Markdown content. It usually consists of metadata like titles, authors, dates, categories, and other custom variables. Frontmatter is enclosed between two lines of three dashes each, providing a way to separate the frontmatter and the content.
Frontmatter allows you to include additional information with your Markdown content that may not be part of the document. For example, you can include the date of publication, categories, author information, SEO metadata, excerpts, and more.
Using frontmatter can also help you manage and organize your content more easily. For example, frontmatter allows you to dynamically generate HTML from a single Markdown document, add custom values to a template, or loop through resources.
Here's a simple example of a frontmatter section in a Markdown file:
---
title: My Post
author: John Doe
date: 2020-06-29
---
Frontmatter is a great way to add additional metadata to your Markdown content, making it easier to manage and organize. It also provides an easy way to output HTML from a single Markdown document or apply custom values to a template.