pr_01m47d15m3e54sn21z27rpy5n9/apps/docs/src/route-data.ts
Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Docs in the shape of docs.continue.dev | 1 | import { defineRouteMiddleware } from '@astrojs/starlight/route-data'; |
| 2 | ||
| 3 | import { tabFor } from './tabs'; | |
| 4 | ||
| 5 | /** Each page's sidebar holds only its tab's groups. */ | |
| 6 | export const onRequest = defineRouteMiddleware((context) => { | |
| 7 | const route = context.locals.starlightRoute; | |
| 8 | const tab = tabFor(route.id); | |
| 9 | route.sidebar = route.sidebar.filter((entry) => entry.type === 'group' && tab.groups.includes(entry.label)); | |
| 10 | }); |