Frontmatter

Complete reference for all supported frontmatter fields.

(Last Edited)

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.
draftbooleanNoWhen true, the file is excluded from directory listings and ::article-list. The page is still accessible by direct URL.

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]
draft: false
---

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.