Create Web Doc
Prerequisites
- Astro-based docs site (Starlight or custom Astro content collections)
- Know the topic title and target section
Workflow
Locate the content directory
- Check for
src/content/docs/(Starlight) orsrc/pages/(plain Astro) - Confirm the section subdirectory for the topic (e.g.,
guides/,reference/,concepts/)
- Check for
Determine the slug
- Derive from topic title: lowercase, words separated by
-, no special chars - Example: "Agent Configuration" →
agent-configuration
- Derive from topic title: lowercase, words separated by
Create the file
- Path:
src/content/docs/<section>/<slug>.md(or.mdxif JSX components needed) - Write frontmatter:
--- title: <Topic Title> description: <One-sentence summary of the page> ---
- Path:
Scaffold content
- Add an intro paragraph: what this topic is and when it matters
- Add
##sections covering the topic's key concepts - Keep prose tight; prefer examples over explanation
Register in sidebar (if manual)
- Check
astro.config.mjsorastro.config.tsfor asidebararray - Add an entry under the correct section group:
{ label: '<Topic Title>', slug: '<section>/<slug>' } - Skip if sidebar is auto-generated (
autogenerateoption present)
- Check
Verify
- Run
pnpm dev(ornpm run dev) and navigate to the page - Confirm title renders, nav entry appears, no build errors
- Run
Anti-patterns
- Do not create pages outside
src/content/docs/for Starlight sites - Do not skip the
descriptionfrontmatter — it powers SEO and link previews - Do not hardcode sidebar order without checking existing convention in
astro.config