Content and Series

Post frontmatter, folder-based series, project link cards, tags, and locales.

Content lives under src/content/<collection>/<locale>/. Frontmatter is validated at build time by src/content.config.ts.

Post frontmatter#

Only title and date are required:

---
title: "My First Note"
description: "Shown in cards and page metadata."
date: 2026-07-10
tags: [Astro, Markdown]
cover: "https://example.com/cover.jpg"
toc: center
draft: false
---
FieldUse
date / updatedDatePublish and revision dates
tagsArchive filtering; discovered automatically
orderChapter order inside a series folder
toccenter, side, true, or false
coverCover image on cards and the post page
commentsPer-post comment switch
math, mermaid, gallery, lightboxFeature hints

Series are folders#

A folder whose index.md has sibling Markdown files becomes a series — exactly like this guide:

posts/en/theme-guide/
├── index.md → /posts/theme-guide/
├── site-and-navigation.md → /posts/theme-guide/site-and-navigation/
└── …

Projects#

Projects are frontmatter-only link cards on /projects/ — the Markdown body is never rendered. links maps freely chosen keys to URLs; generic keys (website, docs, demo, …) and brand keys found in Simple Icons get icons automatically:

---
title: "Astro Narrow"
description: "An Astro-native content theme."
tags: [Astro]
order: 1
links:
github: https://github.com/example/repo
website: https://example.com
---

Tags and archives#

Tags need no registry — Archives collects them from published posts. Filter URLs are shareable: /archives/?tag=Astro.

Locales#

The default locale (en) has no URL prefix; every other locale is a folder name and a URL prefix (zh-cn//zh-cn/…). To add a locale, extend locales in src/config/i18n.ts, i18n.locales in astro.config.mjs, and the allowed lang values in src/content.config.ts, then mirror the content folders.

License

CC BY-NC-SA 4.0 This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Related Posts