stack-starlight
Astro Starlight documentation framework — setup, sidebar navigation, frontmatter, built-in components, asides, theming, i18n, search
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- stack-starlight
- license
- Apache-2.0
- metadata
- { "author": "manuel-retamozo-garcia", "version": "1.0" }
- description
- Astro Starlight documentation framework — setup, sidebar navigation, frontmatter, built-in components, asides, theming, i18n, search
- capabilities
- [ "starlight" ]
02 资源文件 4
- 参考文档references/components-and-authoring.md2.4 KB
- 参考文档references/frontmatter.md2.8 KB
- 参考文档references/setup-and-config.md3.7 KB
- 参考文档references/sidebar-and-customization.md2.9 KB
03 SKILL.md 正文
Starlight Patterns
Documentation-site patterns for Starlight (Astro) projects. Covers project setup, astro.config.mjs configuration, sidebar navigation, page frontmatter, built-in components, Markdown authoring extensions, theming, and i18n.
When to Use
- Scaffolding a docs site (
npm create astro@latest -- --template starlight) - Configuring the
starlight()integration inastro.config.mjs - Building or reorganizing sidebar navigation
- Authoring pages in
src/content/docs/(frontmatter, asides, code blocks) - Using built-in components (Tabs, Cards, Steps, FileTree, etc.)
- Creating custom pages/layouts with
<StarlightPage>or overriding UI components - Customizing theme (logo, fonts,
--sl-*CSS custom properties) or setting up i18n
Core Rules
- File-Based Content: Pages live in
src/content/docs/; folders become URL segments. Every page MUST havetitlein frontmatter — the schema validates and fails the build without it. - Config Entry Point: All site behavior is configured in the
starlight({ ... })integration insideastro.config.mjs.titleis required; set Astro'ssiteto enable sitemap generation. - Sidebar Strategy: Prefer
autogenerate: { directory }per section over hand-listing slugs; control order/label/visibility per page with thesidebarfrontmatter field (order,label,hidden,badge). - Components Need MDX: Built-in components import from
@astrojs/starlight/componentsand only work in.mdx(or Markdoc{% %}tags). Plain.mdsupports asides (:::note…:::) and Expressive Code markers — do not put JSX in.md. - Custom Pages, Not Forks: For non-docs pages use
src/pages/*.astrowrapped in<StarlightPage frontmatter={{ title }}>; to change built-in UI use thecomponentsconfig override map — never copy/patch theme internals. - Theming via Custom Properties: Customize with
customCssfiles overriding--sl-*custom properties (colors,--sl-font); uselogo.light/logo.darkfor theme-aware logos. Applynot-contentclass to opt elements out of content styling. - Search & Visibility: Pagefind search is on by default; exclude a page with
pagefind: falseand keep it out of production builds withdraft: true. - i18n Layout: Declare
locales/defaultLocalein config; mirror content per locale directory. Untranslated pages fall back to the default locale automatically; translate sidebar labels withtranslations.
References
For full configuration options, frontmatter fields, component catalog, and code examples, refer to:
04 同仓库更多 Skills
work-unit-commits
Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.
stack-webmcp
Trigger: WebMCP, document.modelContext, web tools, AI browser agent. Web Model Context Protocol client-side tool standard.
stack-vite
Vite frontend build tool — configuration, plugins, asset loading
stack-sqlserver
Microsoft SQL Server database — indexing, RCSI, set-based operations, SARGable queries, transaction scopes
stack-springboot
Spring Boot architecture patterns — REST API design, layered services, JPA, caching, Spring Security, TDD with MockMvc and Testcontainers, and pre-release verification
stack-react
React UI library — components, hooks, state management, patterns, performance, and component testing with React Testing Library