Frontmatter

Complete reference for all supported frontmatter fields.

Frontmatter is YAML at the top of every .mdx file, delimited by ---.

Fields

FieldTypeRequiredDescription
titlestringYesPage title. Used in <h1>, <title>, and listing cards.
descriptionstringYesMeta description. Used in <meta name="description"> and listing cards.
publish-datestringNoISO date (YYYY-MM-DD). Shown in the article header and listing cards.
last-editedstringNoISO date (YYYY-MM-DD). Shown in the article header only when it is later than publish-date. Falls back to filesystem mtime if omitted.
authorstringNoAuthor name. Shown in the article header.
tagsstring[]NoList of tags. Rendered as badges in the article header.
ordernumberNoOverrides publish-date/slug sorting in listings. Lower values sort first; see Notes.

Example

---
title: My Article
description: A short summary of the article.
publish-date: 2026-01-15
last-edited: 2026-03-01
author: powersagitar
tags: [next.js, mdx]
---

Notes

  • publish-date and last-edited are plain strings — no timezone handling is applied. Use YYYY-MM-DD format consistently to avoid display issues.
  • If last-edited is omitted, the filesystem mtime of the file is used as the fallback. This means the "Last Edited" date updates automatically whenever the file is saved, without any manual frontmatter changes required.
  • last-edited is only displayed in the article header when it is strictly later than publish-date. If publish-date is not set, "Last Edited" is always shown. If you publish and last-edit on the same day, only publish-date is shown.
  • To keep a page out of listings, ::article-list, the sitemap, and the RSS feed, prefix the file or directory name with _ (see Writing Content).
  • Listing order (used by both ::article-list and the automatic directory-listing fallback) is: articles with order set come first, sorted ascending by order; then remaining articles sorted by publish-date descending; undated articles sort last, by slug.