Skip to content
@pyreon/zero-content
zero · content

A typo in your frontmatter fails the build. Not your readers.

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
Documentation
pages
.md and .mdx compiled to Pyreon JSXReal elements at build time, not an HTML string.
frontmatter
any Standard Schema validatorZod, Valibot, ArkType or @pyreon/validate. The package ships none.
build outputs
search index · sitemap · RSS · llms.txt
runs
the pyreon.dev docs and blog200+ Markdown pages, 59 of them with live examples.
A frontmatter typo fails the build, not the page A Markdown post, hello.md, has a typo in its frontmatter: "titel" instead of "title". The frontmatter travels to the blog collection schema, the title check fails, and the build prints: hello.md: frontmatter does not match collection "blog" schema, title is missing. Fixed to "title", the build passes and writes the pages, search index, sitemap, RSS feed and llms.txt. ZERO-CONTENT · TYPED COLLECTIONS src/content/blog/hello.md --- titel: Hello, Pyreon title: Hello, Pyreon date: 2026-11-16 --- # Hello… content.config.ts blog: defineCollection({ schema: z.object({ title: z.string(), date: z.date(), })}) $ zero build checking frontmatter… ✗ hello.md: frontmatter does not match collection "blog" schema (1 issue): - title: expected string ✓ built pages · search index · sitemap · RSS · llms.txt the build stops; readers never see a broken page
  • 200+ Markdown pages on pyreon.dev, compiled by this packagedocs/content.config.ts (collections docs, blog); 221 .md files under docs/src/content/docs on main
  • 59 docs pages that embed a live, clickable exampledocs/src/content/docs: 59 .md files with a line-leading <Example …/> outside code fences (63 mention the name; 4 only in inline code), main e314cc619
  • 0 iframes: an <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 →
why teams pick it

A content site that checks itself.

  1. Frontmatter that cannot lie

    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.

  2. Live examples are real files

    <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.

  3. Search with no service

    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.

  4. Merge today, publish on Mondaynext release

    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.

the difference

Delete the content loader you wrote by hand.

lib/posts.ts, the usual 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, search
content.config.ts + one route

Typed 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')
try it

Write a page. Break the schema.

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.

src/content/docs/install.md

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.

Install

Create a project with one command.

Next steps

Read the routing guide.

what's included

Everything a docs site or blog needs, built in.

  • Markdown and MDX to Pyreon JSX at build time, so the compiler and tree-shaking work on your prose (Shiki code blocks are the one HTML island)
  • Typed collections getCollection, getEntry and getEntries, typed from your schema through a generated .pyreon/content-types.d.ts
  • Components without imports drop a PascalCase .tsx into src/mdx/ and use it in any page by name; an unknown name fails the build with a did-you-mean
  • Live <Example> blocks real .tsx files mounted inline, with share keys for state that spans two examples
  • Directives :::tip, :::warning, :::note, :::danger, :::info, :::code-group, :::math, :::mermaid, :::details, and a warning when you type :::warn
  • Shiki code blocks light and dark themes baked into one render, filename labels, line numbers, {2-3} highlights and a copy button
  • Docs components Tabs, PropTable, APICard, CompatMatrix, PackageBadge, Details, Mermaid, Math, Sidebar, Toc, Breadcrumbs and PrevNext
  • Search a Cmd+K <Search> (or useSearch for your own UI) over a per-collection index written at build
  • Sitemap, RSS and llms.txtnext release from one seo option; the RSS feed can carry full articles for dev.to imports
  • Drafts and scheduled entriesnext release publishDate plus unpublished: 'omit' keep future posts out of the bundle; PYREON_CONTENT_NOW builds the site as it will look on a later date
recipes

Things to build with it.

next release
A blog that publishes on schedule

Date 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 build
Two live examples, one shared signal

Each 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" />
api

One config, a few queries, a box of components.

Every export has a reference page with its signature, an example and the mistakes people make with it.

config · 5
  • defineConfig
  • defineCollection
  • defineComponents
  • mergeComponents
  • @pyreon/zero-content/plugin
query (isPublished: next release) · 7
  • getCollection
  • getEntry
  • getEntries
  • reference
  • resolveReference
  • resolveReferences
  • isPublished
routes and examples · 4
  • defineContentRoute
  • Example
  • registerExamples
  • getOrCreateSharedSignal
components · 13
  • Callout
  • CodeGroup
  • CodeBlock
  • Details
  • Tabs
  • PropTable
  • APICard
  • CompatMatrix
  • PackageBadge
  • Mermaid
  • Math
  • Image
  • Playground
navigation and search · 8
  • Sidebar
  • defineSidebar
  • Toc
  • Breadcrumbs
  • PrevNext
  • Search
  • useSearch
  • loadSearchIndex
good to know

Good to know before you start.

Made for Zero

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.

Bring your own validator

Nothing is re-exported: import z from Zod, or use Valibot, ArkType or @pyreon/validate. Any Standard Schema library works without an adapter.

Pick the right draft mode

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.

Scheduled means next build

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.

questions

What people ask first.

Is the Markdown turned into an HTML string?

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.

Which validator do I need?

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.

Can a draft leak?

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.

Does search need a server or a third-party service?

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.

Can I use it without Zero?

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.

Will my AI assistant see my content?

Yes, through @pyreon/mcp: get_content_collection lists your collections and get_content_entry returns one entry's frontmatter and heading outline.

Write the Markdown. Let the build do the nagging.

bun add @pyreon/zero-content
Read the content guide