Ir al contenido

Understanding Auto-Generated Routes

Esta página aún no está disponible en tu idioma.

The starlight-tags plugin automatically generates two types of pages for your documentation site: a tags index page and individual tag pages.

Default URL: /tags

The tags index page displays all available tags in your documentation. It provides:

  • A tag cloud with all tags sized by popularity
  • Alphabetical index for easy navigation
  • Statistics showing total tags and tagged pages
  • Quick links to individual tag pages

Change the index page URL using the tagsIndexSlug configuration option:

starlightTags({
tagsIndexSlug: 'all-tags', // Changes URL to /all-tags
})

Default URL: /tags/[tag-slug]

Each tag defined in your tags.yml gets its own page showing:

  • Tag information (label, description, icon)
  • Statistics (number of pages, related tags)
  • List of all pages with that tag
  • Related tags section

Change the tag pages URL prefix using the tagsPagesPrefix configuration option:

starlightTags({
tagsPagesPrefix: 'topics', // Changes URLs to /topics/authentication, /topics/webhooks, etc.
})

Override individual tag URLs using the permalink property in tags.yml:

tags:
api-v2:
label: "API v2"
permalink: "api-version-2" # Accessible at /tags/api-version-2

With default configuration:

RouteDescription
/tagsTags index listing all tags
/tags/authenticationAuthentication tag page
/tags/rest-apiREST API tag page

With custom configuration:

starlightTags({
tagsIndexSlug: 'browse',
tagsPagesPrefix: 'topics',
})
RouteDescription
/browseTags index listing all tags
/topics/authenticationAuthentication tag page
/topics/rest-apiREST API tag page
  • Tag Cloud: Visual representation of all tags with sizes based on usage frequency
  • Alphabetical Index: Jump links for quick navigation (A, B, C, …)
  • Statistics Card: Shows total number of tags and tagged pages
  • Search-Friendly: Tags are rendered as links for easy discovery
  • Tag Header: Large badge with icon and label
  • Description: Tag description from tags.yml
  • Stats: Number of pages and related tags
  • Pages List: All documentation pages tagged with this tag
  • Related Tags: Other tags that frequently appear alongside this tag

Tags marked as hidden: true in your configuration:

  • Will not appear in the tags index
  • Will still have their own tag page (accessible via direct URL)
  • Will still function normally for tagging pages
tags:
deprecated:
label: "Deprecated"
hidden: true # Won't appear in /tags index, but /tags/deprecated still works
Check out all [authentication guides](/tags/authentication).
import { TagBadge } from 'starlight-tags/components';
<TagBadge tagId="authentication" />

Tag URLs follow the pattern /{tagsPagesPrefix}/{tag-slug}, where:

  • tag-slug is either the tag ID or the custom permalink if specified