diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index f77b43d3..214a1671 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -128,6 +128,8 @@ The community-tier signup page (`/community`) reuses `LanguageSwitcher.astro` an | `/docs/examples` | Code snippets (Python, Node.js, curl) | | `/docs/api` | OpenAI-compatible API reference (endpoints, auth, rate limits) | +Sidebar navigation comes from each guide's frontmatter (`src/content.config.ts`): `group` picks the section, `order` the position, and an optional `parent` (the entry id of another guide, identical in EN and ES) lists the page as an indented sub-item right under that guide, in the parent's group. The library supports any depth, but content is kept to one level (enforced in `DocsShell.test.ts`), and a child's `order` must be the slot right after its parent so the flat order (`/api/docs` manifest) matches the sidebar. URLs stay flat (`/docs/`); the breadcrumb and prev/next follow the sidebar's visual order. Logic and tests: `src/lib/docsNav.ts`; markup: `src/components/docs/DocsSidebarNav.astro` + `DocsNavList.astro` (rendered in tests with the Astro Container API, `*.render.test.ts`, see `vitest.render.config.ts`). + ### API Endpoints #### `POST /api/waitlist` diff --git a/src/components/docs/DocsNavList.astro b/src/components/docs/DocsNavList.astro new file mode 100644 index 00000000..27e2854c --- /dev/null +++ b/src/components/docs/DocsNavList.astro @@ -0,0 +1,45 @@ +--- +/** + * One level of the docs sidebar: a list of pages, each with the pages nested + * under it (frontmatter `parent`) rendered as an indented sub-list right below. + * + * It recurses through Astro.self, so nesting depth is whatever the data says. + * Sub-items are always shown, not behind a toggle: with a handful of children + * a disclosure button would add a click and a focus stop for no gain, and a + * plain nested