Frontmatter
(Last Edited)
Frontmatter is YAML at the top of every .mdx file, delimited by ---.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Page title. Used in <h1>, <title>, and listing cards. |
description | string | Yes | Meta description. Used in <meta name="description"> and listing cards. |
date | string | No | ISO date (YYYY-MM-DD). Shown in the article header and listing cards. |
lastEdited | string | No | ISO date (YYYY-MM-DD). Shown in the article header only when it differs from date. Falls back to filesystem mtime if omitted. |
author | string | No | Author name. Shown in the article header. |
tags | string[] | No | List of tags. Rendered as badges in the article header. |
draft | boolean | No | When 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
dateandlastEditedare plain strings — no timezone handling is applied. UseYYYY-MM-DDformat consistently to avoid display issues.- If
lastEditedis 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. lastEditedis only displayed in the article header when it differs fromdate. If you publish and last-edit on the same day, onlydateis shown.