A content type is one schema.
Define it once and the types, the editing form and the typed queries all come out of the same definition. Collections are files in your repository, so the content travels with the code.
// src/content.config.ts
const posts = defineCollection({
loader: glob({ pattern: '**/*.md',
base: './src/content/posts' }),
schema: z.object({
title: z.string(),
date: z.coerce.date(),
tags: z.array(z.string()),
draft: z.boolean().default(false),
}),
});One definition, four things.
- 01Typeswhat your editor reads
- 02Formwhat the Content Hub renders
- 03Querywhat a loop emits into the page
- 04Validationwhat every entry is written through
A collection is a table you already know how to read.
Every collection sits in the rail with its count, and its entries are rows: a title, a status you switch between Live and Draft, and one column per field. Switch a collection public and each entry becomes a page with its own route.
Fourteen field types, one click each.
Add field opens the whole list. Pick one and it is a column in the table, an input in every entry and a key a loop binds to — Title and Slug ship with every collection, and a group or a repeating item holds fields of its own.
A loop is a query, and what repeats is ordinary markup.
Wrap a card in a Loop, point it at a collection, a data source or an expression, and bind the fields you want. The page emits a real query and a real .map() — the cards below are what the one card above them turns into. Wrap the Loop in a Filter and visitors can search, narrow and sort it — on a static site, with no server.
Files by default. Rows when files run out.
Files in git
One data file, or a Markdown file per entry the way Astro sites keep their posts — versioned with the code, diffable, and static by default. Nothing to host, nothing to migrate.
- src/content/<type>/<slug>.md
- History and review through git
- Builds with the network down
Rows in a database
For the three things files cannot do: changing content without a commit (a rebuild still publishes it), data a visitor writes, and a collection large enough to need a query.
- libSQL or PostgreSQL, yours
- An ordinary Drizzle project in src/db
- Loops still read at build time
Somebody else’s content, picked like a collection.
WordPress or EmDash, a REST or GraphQL API, a feed, a Google Sheet: define a source once under Content, test it where you define it, and pick it in a Loop like any collection. What lands on disk is one module per source that fetches while the site is built — the code you would have written, and it keeps building with sitereal deleted.
WordPressmysite.localpostspictures: copiedsrc/data/sources/news.js- WordPress
- EmDash
- REST API
- GraphQL
- RSS or Atom
- Google Sheet or CSV
- JSON file
- List typed here
- Custom code
/wp-json/wp/v2/postsHeadless WordPress or EmDash
WordPress needs nothing installed, and EmDash takes one approval. Titles, content, pictures, authors and terms arrive as plain fields, ACF included — and the free companion plugins rebuild the site when you publish.
/2026/09/hello-worldA page for every post
One entry design, edited on the canvas, becomes a page per row — in a folder, at the top level, or exactly where WordPress had it, so a site that moves keeps every address. Links between posts follow, and the sitemap lists them.
public/media/sources/Pictures come home
Copy a source’s pictures and files into the project and they are served from your domain and resized by the build. It works for a WordPress that only runs on your laptop, and every publish copies again first.
offline: commitBuilds with the source down
Keep the last rows in the build cache or in the repository, and a source that cannot be reached builds from that copy instead of taking the deploy down.
tags: ["release"]Taxonomies are fields
Tags and categories are terms assigned in the entry form: a loop prints them by name, filters by them, and a Filter offers them as facets — no join table, no plugin.
<Condition>Conditions are elements
Wrap anything in a Condition and it emits the expression you wrote. Several clauses fold left to right, every step in brackets.
/uploads/hero.jpgMedia is the repository
Assets live under public/ with their alt text, offered as a picker, and photographs ship with a real srcset. Nothing is uploaded anywhere.
Start building the sites you’ve always wanted.
Seven days free, on your machine — and every site you build is real Astro in your own repository, yours from the first save.
