Frontmatter
Learn how to use frontmatter in MDX files.
The frontmatter is an important part of an MDX file. It is used to define information about the content of the file, such as title, description, author, publication date, etc.
The metadata header is defined at the beginning of the file, between ---
(three hyphens) at the beginning and end.
Format
The metadata header is defined in key-value format, where the key is the name of the metadata and the value is the content of the metadata.
Example:
Depending on the type of document (documentation, blog post, etc.), different metadata can be used.
Metadata for documentation
title
description
links
source
docs
blog
api
Example:
Metadata for blog posts
author_id
It is the identifier of the post author.
It must match the author id
defined in the src/config/blog.ts
file,
which is the file that contains the authors' complete data.
og_image
This is the image that will be used as the post's featured image when shared on social media if you do not want to use the automatically generated image.
Images must be stored in the public/blog-og
folder.
Use only the image file name and extension.
title
excerpt
date
author_id
og_image
tags
links
source
docs
blog
api
Example: