--- // Shared sidebar for the /docs section. // Renders Tutorials + Reference + Commands, highlighting the current entry. // Used by: // - site/pages/docs/index.astro (no active entry) // - site/layouts/Doc.astro (activeCommand) // - site/pages/tutorials/[...slug].astro (activeTutorial) import { getCollection } from 'astro:content'; import { SKILL_CATEGORIES, CATEGORY_ORDER, CATEGORY_LABELS, } from '../data/sub-pages-data'; interface Props { activeCommand?: string; activeReference?: string; activeTutorial?: string; } const { activeCommand, activeReference, activeTutorial } = Astro.props; const tutorials = (await getCollection('tutorials')) .sort((a, b) => a.data.order - b.data.order); const reference = (await getCollection('reference')) .sort((a, b) => a.data.order - b.data.order); const referenceGroups = [ { section: 'concepts', label: 'Core concepts' }, { section: 'automation', label: 'Automation' }, { section: 'reference', label: 'Reference' }, ]; const skills = await getCollection('skills'); const sidebarGroups: Record = {}; for (const cat of CATEGORY_ORDER) { sidebarGroups[cat] = skills .filter(e => (SKILL_CATEGORIES[e.id] || 'system') === cat) .sort((a, b) => a.id.localeCompare(b.id)) .map(e => ({ slug: e.id })); } ---