Skip to main content
Content collections give you a type-safe way to work with structured content in Aero. Define a schema, query items at build time with getCollection(), and render Markdown with render(). Aero validates frontmatter against your schema and hot-reloads when content changes.

Define a collection

Declare collections in content.config.ts at the project root:
content.config.ts
The content API uses Standard Schema, so you can use Zod, ArkType, Valibot, or any spec-compliant validator.

Query a collection

Use getCollection() inside a <script is:build> block to fetch all items:
client/pages/docs/index.html
Each item has an id (derived from the filename) and a data object with validated frontmatter fields.

Render Markdown

Call render() to convert a collection item’s Markdown body to HTML:
client/pages/docs/[slug].html

Single-file Markdown import

For simple cases where you need to import a single Markdown file without defining a full collection, Aero supports direct Markdown imports in build scripts. See the content collections guide for details.
In development, edits to Markdown files or content.config.ts trigger a hot update so Vite refreshes importers without a full page reload.