The landing page and docs site. Every page is prerendered from markdown, and every page also has
a plain-markdown twin at the same URL plus .md, for LLMs and agents:
/docs/core/introductionrenderspackages/core/docs/introduction.md/docs/core/introduction.mdserves the same file as text/llms.txtindexes every page;/llms-full.txthas all of them in one file, and each package has its own under/docs/<package>/
pnpm docs # dev server on http://localhost:5190
pnpm --filter @homeostate/docs build # static site in apps/docs/build/client
pnpm --filter @homeostate/docs preview # serve the build with Cloudflare's local emulator| File | URL |
|---|---|
packages/<name>/docs/*.md |
/docs/<name>/<file>; introduction.md is required |
packages/<name>/CHANGELOG.md |
/docs/<name>/changelog, generated by Changesets |
apps/docs/content/*.md |
/docs/<file>, for guides that span packages |
A public package appears on the site once it has docs/introduction.md. Private workspace
packages are excluded from the catalog. Package folders are flat;
images go in docs/assets/. The sidebar label and order of each package, and the role its
introduction's page title names ("Yjs CRDT backend"), are in src/site.config.ts,
as is each CRDT backend's one-line trade-off on the landing page; keep those in step with the
package's docs.
---
description: One sentence, at most 160 characters, for search results and llms.txt.
order: 2
---
# Page title
Body…- The H1 on the first line is the title. It is the only H1.
descriptionis required.label(a shorter sidebar label),orderanddraft: trueare optional; drafts show in dev and are left out of production builds.- Link to files, not URLs:
./connecting.md#options,../../crdt-yjs/docs/introduction.md,../src/index.ts. Those links work on GitHub and innode_modules, and the build turns them into site paths, absolute.mdURLs in the markdown twins, or GitHub links for source files. Package pages link to guides by site path:/docs/getting-started.
Everything stays plain GitHub markdown, so the .md twin is exactly what you wrote. The site
renders these more richly:
| Write | The site renders |
|---|---|
> [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION] |
A callout |
```ts title="store.ts" {2,4-6} |
A titled block with highlighted lines |
```bash install holding one npm install … line |
npm / pnpm / yarn / bun tabs |
Consecutive fences with tab="Zustand", tab="Redux" |
One tabbed code group |
```diff |
Added and removed lines highlighted |
Fence languages: ts, tsx, js, jsx, json, bash, sh, diff, yaml, md, text.
pnpm test checks every page and fails on a broken link or anchor, bad frontmatter, a second
H1, raw HTML, an unknown fence language or meta, or shiki's // [!code …] comments (they would
show up in the .md).
The getting-started guide's src/counter.ts and src/App.tsx snippets are also checked against
the executable fixtures in apps/playground-react/src/__tests__/fixtures/quickstart/. Update
both together: CI typechecks the fixtures and tests the counter UI, two-peer synchronization,
and a new peer joining an existing room.
React Router in framework mode with ssr: false: src/routes.ts registers a
static route for every page and every .md twin from the content manifest, so prerender: true
renders the whole site. Loaders run only at build time. They parse and highlight the markdown
(src/content), and the page ships as hast that the client renders with shadcn
components, so remark and shiki never reach the browser.
scripts/postbuild.ts then adapts the output for Cloudflare Pages
(x/index.html to x.html, 404.html, _headers, _redirects) and checks it.