Install
Create a project with one command.
Next steps
Read the routing guide.
Write docs and blogs in Markdown or MDX. Zero compiles every page to real Pyreon components at build time, checks each frontmatter block against your schema, and writes the search index, sitemap, RSS feed and llms.txt for you.
bun add @pyreon/zero-content @pyreon/validate. The package ships none.<Example> mounts inside the page, sharing its signalspackages/zero/zero-content/src/components/Example.tsx (header: "NOT iframe")synthetic · author-run · M3 Max · record of 2026-11-05
Every result, including where we lose →Give a collection a schema. Drop the title from a post and the build stops with src/content/blog/hello.md: frontmatter does not match collection "blog" schema, followed by the field and the reason. Your types come from the same schema.
<Example file="./examples/counter" /> mounts a real .tsx file inline, so it is type-checked, linted and refactored with the rest of your code. Give two examples the same share key and they share one signal: click in one, the other updates.
The build writes a search index per collection, and <Search> opens it with Cmd+K and loads it lazily. No crawler, no API key, and it works in vite dev too.
Name a date field with publishDate and a post dated in the future stays out of lists, search and feeds until that day; add unpublished: 'omit' and it is not even bundled. pyreon.dev/blog schedules its posts this way.
A loader you own. Markdown rendering, RSS, sitemap and search are still to write.
import fs from 'node:fs/promises'
import path from 'node:path'
import matter from 'gray-matter'
import { z } from 'zod'
const Post = z.object({ title: z.string(), date: z.coerce.date(), draft: z.boolean().optional() })
const dir = path.join(process.cwd(), 'content/blog')
export async function getPosts() {
const files = (await fs.readdir(dir)).filter((f) => f.endsWith('.md'))
const posts = await Promise.all(
files.map(async (file) => {
const { data, content } = matter(await fs.readFile(path.join(dir, file), 'utf8'))
const parsed = Post.safeParse(data)
if (!parsed.success) throw new Error(`${file}: ${parsed.error.message}`)
return { slug: file.replace(/\.md$/, ''), data: parsed.data, content }
}),
)
return posts.filter((p) => !p.data.draft).sort((a, b) => +b.data.date - +a.data.date)
}
// still to write: Markdown → HTML, the [slug] page, RSS, sitemap, searchTyped entries, drafts skipped in production, a page per post with its <title> set.
// content.config.ts
import { defineConfig, defineCollection } from '@pyreon/zero-content'
import { z } from 'zod'
export default defineConfig({
collections: {
blog: defineCollection({
type: 'pages',
schema: z.object({ title: z.string(), date: z.date(), draft: z.boolean().optional() }),
}),
},
})
// src/routes/blog/[slug].tsx
import 'virtual:zero-content/collections'
import { defineContentRoute, getCollection } from '@pyreon/zero-content'
import type { GetStaticPaths } from '@pyreon/zero/server'
export const getStaticPaths: GetStaticPaths<{ slug: string }> = async () =>
(await getCollection('blog')).map((post) => ({ params: { slug: post.slug } }))
export default defineContentRoute('blog')Edit the Markdown on the left and the page renders on the right, :::tip callout included. Delete the title line to see the build error you would get.
The frontmatter check is the real one: a defineCollection Zod schema and the content plugin's error text. The preview renders a small Markdown subset in the page; the build uses the full remark pipeline.
✓ valid · Get Pyreon running in a minute.
Create a project with one command.
Read the routing guide.
getCollection, getEntry and getEntries, typed from your schema through a generated .pyreon/content-types.d.ts.tsx into src/mdx/ and use it in any page by name; an unknown name fails the build with a did-you-mean<Example> blocks real .tsx files mounted inline, with share keys for state that spans two examples:::tip, :::warning, :::note, :::danger, :::info, :::code-group, :::math, :::mermaid, :::details, and a warning when you type :::warn{2-3} highlights and a copy button<Search> (or useSearch for your own UI) over a per-collection index written at buildseo option; the RSS feed can carry full articles for dev.to importspublishDate plus unpublished: 'omit' keep future posts out of the bundle; PYREON_CONTENT_NOW builds the site as it will look on a later dateDate a post in the future, merge it now. Production builds leave it out of the bundle, the RSS feed, the sitemap and search until its day, and the feed carries whole articles for readers and dev.to imports.
// content.config.ts
import { defineConfig, defineCollection } from '@pyreon/zero-content'
import { z } from 'zod'
export default defineConfig({
collections: {
blog: defineCollection({
type: 'pages',
schema: z.object({
title: z.string(),
description: z.string(),
date: z.date(),
tags: z.array(z.string()).default([]),
draft: z.boolean().optional(),
}),
publishDate: 'date', // dated in the future = unpublished until that day
unpublished: 'omit', // and not bundled at all in production
}),
},
})
// vite.config.ts
import pyreon from '@pyreon/vite-plugin'
import zero from '@pyreon/zero/server'
import content from '@pyreon/zero-content/plugin'
export default {
plugins: [
content({
seo: {
baseUrl: 'https://example.com',
sitemap: true,
rss: { collection: 'blog', title: 'My blog', path: 'blog/rss.xml', content: 'full' },
llms: { title: 'My site' },
},
}),
pyreon(),
zero(),
],
}
// Preview launch day: PYREON_CONTENT_NOW=2026-12-01 vite buildEach example is an ordinary component file. Give both the same share key and the button in one drives the readout in the other, inline in the page.
// src/examples/counter-button.tsx
import { signal, type Signal } from '@pyreon/reactivity'
export default function CounterButton(props: { shared?: Signal<number> }) {
const count = props.shared ?? signal(0)
return <button onClick={() => count.update((n) => n + 1)}>Clicked {() => count()} times</button>
}
// src/examples/counter-readout.tsx
import { signal, type Signal } from '@pyreon/reactivity'
export default function CounterReadout(props: { shared?: Signal<number> }) {
const count = props.shared ?? signal(0)
return <p>The other example says {() => count()}. Doubled: {() => count() * 2}</p>
}
// src/entry-client.ts (once)
import { startClient } from '@pyreon/zero/client'
import { registerExamples } from '@pyreon/zero-content'
import { routes } from 'virtual:zero/routes'
registerExamples(import.meta.glob('./examples/**/*.tsx') as Record<string, () => Promise<unknown>>)
startClient({ routes })
<!-- any .md page -->
<Example file="./examples/counter-button" share="clicks" />
<Example file="./examples/counter-readout" share="clicks" />Every export has a reference page with its signature, an example and the mistakes people make with it.
Pages render through Zero's file router and render modes. You write the route (one defineContentRoute call, plus getStaticPaths and the collections import for static builds); the package has no standalone mode.
Nothing is re-exported: import z from Zod, or use Valibot, ArkType or @pyreon/validate. Any Standard Schema library works without an adapter.
By default an unpublished entry is left out of lists, search and feeds but still bundled, for preview on SSR sites. On a static site set unpublished: 'omit' (shipping in the next release) so a draft's text never reaches a public chunk.
Scheduling lands in the next release. A static site decides what is published when it builds, so a post dated Monday appears with the first deploy on or after Monday. pyreon.dev runs a daily deploy for that reason.
No. Every Markdown node becomes a JSX element at build time, so your prose goes through the same compiler as your components. Shiki-highlighted code is the one exception: it arrives as pre-coloured HTML.
Any Standard Schema library: Zod, Valibot, ArkType, typia or @pyreon/validate. The package calls the standard validate method and ships no validator of its own.
getCollection skips draft: true entries in production. In the next release the search index, sitemap, RSS and llms.txt leave them out too, and with unpublished: 'omit' the draft is not bundled at all, which is what a static site wants.
No. The build writes JSON index files into your build output and the browser fetches them the first time search opens. In dev a middleware builds the same index on demand.
No. The integration with Zero (its file router, render modes and image handling) is the point of the package. For SEO output from a standalone script, @pyreon/zero exports generateRssFeed, and @pyreon/zero/server exports seoPlugin and aiPlugin.
Yes, through @pyreon/mcp: get_content_collection lists your collections and get_content_entry returns one entry's frontmatter and heading outline.
bun add @pyreon/zero-content