Folder layout
Models, content, blocks, and the catch-all route.
The first document used a model, a content file, and a route. Those folders are the registry. Adding a file is enough. Nothing else has to be imported by hand.
The tree
backmatter.config.ts
models/blog.ts
content/blog/hello.mdx
blocks/Hero.tsx
layouts/blog.tsx
app/[...backmatter]/page.tsx
.backmatter/
| Path | Role |
|---|---|
backmatter.config.ts | Workspace and API settings. Models are not listed here. |
models/{type}.ts | export default defineModel(...). The file name is model.type. |
content/{type}/{slug}.mdx | One document. |
blocks/{Name}.tsx | A React component used as an MDX tag. The file name is the tag. |
layouts/{type}.tsx | Optional wrapper for every document of that type. |
sources/{type}.ts | export default defineSource(...) for a model with external: true. Loads the outside record (a catalog product) that blocks receive as props.data. See External sources. |
app/[...backmatter]/page.tsx | One route that mounts every model. |
.backmatter/ | Generated client. Gitignored. Import it as backmatter. |
route on the model is the public URL. route: "/blog/{slug}" serves content/blog/hello.mdx at /blog/hello.
Content is what happens after the file exists: the published copy, the working copy an editor changes, and the commit publish writes back to git.