Getting Started
Esta página aún no está disponible en tu idioma.
A plugin to add tags to your Starlight documentation site. Tags help organize and categorize your content, making it easier for users to discover related pages.
Prerequisites
Section titled “Prerequisites”You will need to have a Starlight website set up. If you don’t have one yet, you can follow the “Getting Started” guide in the Starlight docs to create one.
Installation
Section titled “Installation”-
starlight-tagsis a Starlight plugin. Install it by running the following command in your terminal:Terminal window npm install starlight-tagsTerminal window pnpm add starlight-tagsTerminal window yarn add starlight-tags -
Configure the plugin in your Starlight configuration in the
astro.config.mjsfile.astro.config.mjs import starlight from '@astrojs/starlight'import { defineConfig } from 'astro/config'import starlightTags from 'starlight-tags'export default defineConfig({integrations: [starlight({plugins: [starlightTags()],title: 'My Docs',}),],}) -
Create a
tags.ymlfile to define your tags. Place it in your project root, or in a subfolder likesrc/config/by setting theconfigPathoption:tags.yml tags:getting-started:label: "Getting Started"description: "Essential first steps"color: "#22c55e"icon: "🚀"priority: 100components:label: "Components"description: "UI building blocks"color: "#3b82f6"icon: "🧩"advanced:label: "Advanced"description: "For experienced users"color: "#f59e0b"icon: "⚡"difficulty: advancedprerequisites:- getting-starteddefaults:color: "#6b7280" -
Add tags to your pages using frontmatter:
---title: Authentication Guidetags:- authentication- rest-api- stable---Your content here... -
Start the development server to preview the plugin in action.
What You Get
Section titled “What You Get”After installation, the plugin automatically creates:
- Tags Index Page at
/tags- Lists all available tags - Tag Detail Pages at
/tags/[tag]- Shows all pages for each tag
Next Steps
Section titled “Next Steps”- Configuring the Plugin - all available options and defaults
- Defining Tags Schema - colors, icons, priorities, and more
- Using Page Frontmatter - tag your documentation pages
- Components - render tags anywhere in your content
- Understanding Auto-Generated Routes - how tag index and detail pages work
- Extending the Schema - add custom fields for your use case