How Navigation Works

Understand how Compass builds category pages, article links, and sidebar structure from your docs data.

Compass Teampublishednavigationrouting

Compass keeps navigation explicit. Instead of inferring everything from folders, it combines your docs data file with article frontmatter and route templates. ## The key files - src/data/docs.ts defines parent sections, sub-categories, labels, descriptions, and slugs - src/content/docs stores the articles and their frontmatter - src/pages/[parent]/[category]/index.astro renders sub-category pages - src/pages/[parent]/[category]/[slug].astro renders article pages - src/components/Sidebar.astro renders the per-section sidebar ## How article links are generated Each article uses a category value in frontmatter. Compass matches that value to a category slug from src/data/docs.ts, then builds the URL from the category slug plus the article filename. For example: ```mdx