Published developer guides live as .md or .mdx files under packages/content/docs/. apps/site discovers that folder recursively through @wailspring/content/paths and owns schema validation, routing, indexes, link rewriting, and MDX components. The content package itself has no build step or framework dependency.
Minimal page
Create packages/content/docs/guides/my-feature.md (or scaffold one with pnpm wailspring doc guides/my-feature --site --apply; see Workspace CLI). Only title and description are required:
---
title: My feature
description: How to use the feature and check its result.
---
## Usage
Explain the behavior. Link to [setup](../getting-started.mdx#workspace-commands).
Astro publishes this file at /docs/guides/my-feature/ and adds it to the landing page, /docs/ index, and previous/next pager automatically—no manual route or navigation edit is needed.
Path rules:
- Use lowercase kebab-case filenames and keep them stable; file paths become public URLs (frontmatter does not override routes).
- Do not create both
foo.md and foo.mdx in the same folder.
- Any
README.md or README.mdx (any casing, at any depth) is treated as a repository note and excluded before schema validation.
- The page layout renders
title as the <h1>. If a file starts with a matching # Title heading for GitHub readability, Astro strips that duplicate <h1> automatically. Start body sections at ## so they appear in the “On this page” table of contents.
Frontmatter schema and ordering
The Astro Content Collections Zod schema lives in apps/site/src/content.config.ts (using Astro 7’s glob loader and astro/zod):
| Field |
Accepted value |
Default |
title |
Nonempty string |
Required |
description |
Nonempty string |
Required |
section |
Nonempty string |
Guides |
order |
Nonnegative integer |
100 |
summary |
Nonempty string |
Same as description |
tags |
Array of nonempty strings |
[] |
published |
Boolean |
true |
Text fields (title, description, section, summary) are trimmed. Pages sort by ascending order, with ties broken by case-sensitive lexical source ID (independent of host locale). section is a display label and does not alter URLs or sort order.
Set published: false to mark a guide as a draft: Astro skips generating its route and omits it from indexes and the pager, though frontmatter must still match the schema. Draft files remain tracked in Git—do not treat published: false as access control, and avoid linking published guides to drafts or README files.
Source-relative links
Write standard Markdown links to sibling or nested source files so links work in GitHub, editors, and the built site:
[Release instructions](./releases.md)
[A nested topic](../folder/file.mdx#heading)
[Setup commands](./getting-started.mdx#workspace-commands)
At build time, apps/site/src/lib/remark-doc-links.mjs rewrites inline and reference-style Markdown links targeting .md/.mdx files inside packages/content/docs/ into /docs/.../ URLs, preserving query strings and #fragment anchors (for example ./getting-started.mdx#workspace-commands becomes /docs/getting-started/#workspace-commands).
External URLs, absolute /... paths, images, assets, code blocks, and links outside packages/content/docs/ stay untouched. Raw HTML or JSX href attributes are not rewritten—use /docs/.../ directly inside JSX components.
Static MDX components
Use .mdx when a guide needs rendered UI examples or callouts via the Astro MDX integration. apps/site renders MDX to static HTML with no React runtime or hydration islands. App-owned Astro components live under apps/site/src/components/ and import via @/:
import Callout from '@/components/Callout.astro';
import { Button, TextLink } from '@wailspring/ui/astro';
<Callout tone="tip" title="Static HTML">
This content renders during the Astro build.
</Callout>
<Button href="/docs/getting-started/">Getting started</Button>
<TextLink href="/docs/" tone="back">All docs</TextLink>
Button (@wailspring/ui/astro): Renders <a> when href is set, or <button type="button"> otherwise (override with type="submit" or type="reset" in forms; disabled applies only to <button>).
TextLink (@wailspring/ui/astro): Requires href and accepts tone="default" | "back".
- Both primitives forward native HTML/ARIA attributes and
class, escape slot expressions, use @wailspring/design-system/recipes (Panda CSS recipes), and ship zero React or client JS. Do not import @wailspring/ui/styles.css into apps/site.
- Token specimens and preview frames: Import
ColorSwatches, TypographyScale, SpacingScale, and ComponentPreview from @wailspring/docs/astro, as shown in apps/site/src/components/DesignSystemShowcase.astro and Design system.
Build and verify
From the repository root:
pnpm run build:site
pnpm --filter @wailspring/site check
pnpm --filter @wailspring/site test
pnpm --filter @wailspring/site test checks every generated HTML page for valid internal links, destination #fragment IDs, accessibility landmarks, theme controls, zero React runtime, and local fonts/licenses. Root pnpm test also tests nested MD/MDX discovery, frontmatter defaults, draft exclusion, and @wailspring/ui/astro primitives. Open /docs/ and your new page locally to check headings, light/dark themes, keyboard focus, and mobile layout. Generated dist/, .astro/, and styled-system/ directories stay untracked.
Published developer guides live as
.mdor.mdxfiles underpackages/content/docs/.apps/sitediscovers that folder recursively through@wailspring/content/pathsand owns schema validation, routing, indexes, link rewriting, and MDX components. The content package itself has no build step or framework dependency.Minimal page
Create
packages/content/docs/guides/my-feature.md(or scaffold one withpnpm wailspring doc guides/my-feature --site --apply; see Workspace CLI). Onlytitleanddescriptionare required:Astro publishes this file at
/docs/guides/my-feature/and adds it to the landing page,/docs/index, and previous/next pager automatically—no manual route or navigation edit is needed.Path rules:
foo.mdandfoo.mdxin the same folder.README.mdorREADME.mdx(any casing, at any depth) is treated as a repository note and excluded before schema validation.titleas the<h1>. If a file starts with a matching# Titleheading for GitHub readability, Astro strips that duplicate<h1>automatically. Start body sections at##so they appear in the “On this page” table of contents.Frontmatter schema and ordering
The Astro Content Collections Zod schema lives in
apps/site/src/content.config.ts(using Astro 7’sglobloader andastro/zod):titledescriptionsectionGuidesorder100summarydescriptiontags[]publishedtrueText fields (
title,description,section,summary) are trimmed. Pages sort by ascendingorder, with ties broken by case-sensitive lexical source ID (independent of host locale).sectionis a display label and does not alter URLs or sort order.Set
published: falseto mark a guide as a draft: Astro skips generating its route and omits it from indexes and the pager, though frontmatter must still match the schema. Draft files remain tracked in Git—do not treatpublished: falseas access control, and avoid linking published guides to drafts orREADMEfiles.Source-relative links
Write standard Markdown links to sibling or nested source files so links work in GitHub, editors, and the built site:
At build time,
apps/site/src/lib/remark-doc-links.mjsrewrites inline and reference-style Markdown links targeting.md/.mdxfiles insidepackages/content/docs/into/docs/.../URLs, preserving query strings and#fragmentanchors (for example./getting-started.mdx#workspace-commandsbecomes/docs/getting-started/#workspace-commands).External URLs, absolute
/...paths, images, assets, code blocks, and links outsidepackages/content/docs/stay untouched. Raw HTML or JSXhrefattributes are not rewritten—use/docs/.../directly inside JSX components.Static MDX components
Use
.mdxwhen a guide needs rendered UI examples or callouts via the Astro MDX integration.apps/siterenders MDX to static HTML with no React runtime or hydration islands. App-owned Astro components live underapps/site/src/components/and import via@/:Button(@wailspring/ui/astro): Renders<a>whenhrefis set, or<button type="button">otherwise (override withtype="submit"ortype="reset"in forms;disabledapplies only to<button>).TextLink(@wailspring/ui/astro): Requireshrefand acceptstone="default" | "back".class, escape slot expressions, use@wailspring/design-system/recipes(Panda CSS recipes), and ship zero React or client JS. Do not import@wailspring/ui/styles.cssintoapps/site.ColorSwatches,TypographyScale,SpacingScale, andComponentPreviewfrom@wailspring/docs/astro, as shown inapps/site/src/components/DesignSystemShowcase.astroand Design system.Build and verify
From the repository root:
pnpm --filter @wailspring/site testchecks every generated HTML page for valid internal links, destination#fragmentIDs, accessibility landmarks, theme controls, zero React runtime, and local fonts/licenses. Rootpnpm testalso tests nested MD/MDX discovery, frontmatter defaults, draft exclusion, and@wailspring/ui/astroprimitives. Open/docs/and your new page locally to check headings, light/dark themes, keyboard focus, and mobile layout. Generateddist/,.astro/, andstyled-system/directories stay untracked.