← Home

Frontmatter

(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.
datestringNoISO date (YYYY-MM-DD). Shown in the article header and listing cards.
lastEditedstringNoISO date (YYYY-MM-DD). Shown in the article header only when it differs from 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 <ArticleList>. The page is still accessible by direct URL.

Example

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

Notes

  • date and lastEdited are plain strings — no timezone handling is applied. Use YYYY-MM-DD format consistently to avoid display issues.
  • If lastEdited 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.
  • lastEdited is only displayed in the article header when it differs from date. If you publish and last-edit on the same day, only date is shown.