From 78fdabe8afb41a3024cca5f60ca296b64b14b6cf Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 14 Jan 2025 13:31:01 -0500 Subject: [PATCH] docs: split site with starlight-sidebar-topics --- packages/site/astro.config.ts | 111 +++++++++++++++++++--------------- packages/site/package.json | 1 + pnpm-lock.yaml | 13 ++++ 3 files changed, 75 insertions(+), 50 deletions(-) diff --git a/packages/site/astro.config.ts b/packages/site/astro.config.ts index effa898a..c89f8e2f 100644 --- a/packages/site/astro.config.ts +++ b/packages/site/astro.config.ts @@ -1,6 +1,7 @@ import starlight from "@astrojs/starlight"; import { defineConfig } from "astro/config"; import { remarkHeadingId } from "remark-custom-heading-id"; +import starlightSidebarTopics from "starlight-sidebar-topics"; export default defineConfig({ integrations: [ @@ -14,56 +15,66 @@ export default defineConfig({ logo: { src: "src/assets/favicon.png", }, - sidebar: [ - { label: "About", link: "about" }, - { label: "CLI", link: "cli" }, - { label: "Configuration", link: "configuration" }, - { label: "FAQs", link: "faqs" }, - { label: "Glossary", link: "glossary" }, - { - collapsed: true, - items: [ - { label: "About", link: "engine/about" }, - { - items: [ - { label: "Bases", link: "engine/concepts/bases" }, - { label: "Blocks", link: "engine/concepts/blocks" }, - { label: "Presets", link: "engine/concepts/presets" }, - { label: "Templates", link: "engine/concepts/templates" }, - ], - label: "Concepts", - }, - { - items: [ - { label: "Contexts", link: "engine/runtime/contexts" }, - { label: "Creations", link: "engine/runtime/creations" }, - { label: "Execution", link: "engine/runtime/execution" }, - { label: "Inputs", link: "engine/runtime/inputs" }, - { label: "Merging", link: "engine/runtime/merging" }, - ], - label: "Runtime", - }, - { - items: [ - { label: "Creators", link: "engine/apis/creators" }, - { label: "Producers", link: "engine/apis/producers" }, - { label: "Runners", link: "engine/apis/runners" }, - ], - label: "APIs", - }, - { - items: [ - { label: "create-fs", link: "engine/packages/create-fs" }, - { - label: "create-testers", - link: "engine/packages/create-testers", - }, - ], - label: "Packages", - }, - ], - label: "Templating Engine", - }, + plugins: [ + starlightSidebarTopics([ + { + icon: "open-book", + items: [ + { label: "About", link: "about" }, + { label: "CLI", link: "cli" }, + { label: "Configuration", link: "configuration" }, + { label: "FAQs", link: "faqs" }, + { label: "Glossary", link: "glossary" }, + ], + label: "Get Started", + link: "/about", + }, + { + icon: "information", + items: [ + { label: "About", link: "engine/about" }, + { + items: [ + { label: "Bases", link: "engine/concepts/bases" }, + { label: "Blocks", link: "engine/concepts/blocks" }, + { label: "Presets", link: "engine/concepts/presets" }, + { label: "Templates", link: "engine/concepts/templates" }, + ], + label: "Concepts", + }, + { + items: [ + { label: "Contexts", link: "engine/runtime/contexts" }, + { label: "Creations", link: "engine/runtime/creations" }, + { label: "Execution", link: "engine/runtime/execution" }, + { label: "Inputs", link: "engine/runtime/inputs" }, + { label: "Merging", link: "engine/runtime/merging" }, + ], + label: "Runtime", + }, + { + items: [ + { label: "Creators", link: "engine/apis/creators" }, + { label: "Producers", link: "engine/apis/producers" }, + { label: "Runners", link: "engine/apis/runners" }, + ], + label: "APIs", + }, + { + items: [ + { label: "create-fs", link: "engine/packages/create-fs" }, + { + label: "create-testers", + link: "engine/packages/create-testers", + }, + ], + label: "Packages", + }, + ], + label: "Templating Engine", + link: "/engine/about", + }, + ]), ], social: { github: "https://github.com/JoshuaKGoldberg/create", diff --git a/packages/site/package.json b/packages/site/package.json index f8232306..f48263c7 100644 --- a/packages/site/package.json +++ b/packages/site/package.json @@ -16,6 +16,7 @@ "astro": "^5.1.6", "remark-custom-heading-id": "^2.0.0", "starlight-package-managers": "^0.9.0", + "starlight-sidebar-topics": "^0.3.0", "typescript": "^5.7.3" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c8f74f6b..755c14c9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -250,6 +250,9 @@ importers: starlight-package-managers: specifier: ^0.9.0 version: 0.9.0(@astrojs/starlight@0.31.0(astro@5.1.6(@types/node@22.10.6)(jiti@2.4.2)(rollup@4.29.1)(typescript@5.7.3)(yaml@2.7.0))) + starlight-sidebar-topics: + specifier: ^0.3.0 + version: 0.3.0(@astrojs/starlight@0.31.0(astro@5.1.6(@types/node@22.10.6)(jiti@2.4.2)(rollup@4.29.1)(typescript@5.7.3)(yaml@2.7.0))) typescript: specifier: ^5.7.3 version: 5.7.3 @@ -3726,6 +3729,12 @@ packages: peerDependencies: '@astrojs/starlight': '>=0.22.0' + starlight-sidebar-topics@0.3.0: + resolution: {integrity: sha512-B7ma+xtRNBHtxEYi5yGYtAnJZviAoj1PXNh5CjuoEqKIBVB7uRAjWsWuPLzv/OrY81jHRjaZc3ilw5mNzks7kg==} + engines: {node: '>=18'} + peerDependencies: + '@astrojs/starlight': '>=0.30.0' + std-env@3.8.0: resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==} @@ -8650,6 +8659,10 @@ snapshots: dependencies: '@astrojs/starlight': 0.31.0(astro@5.1.6(@types/node@22.10.6)(jiti@2.4.2)(rollup@4.29.1)(typescript@5.7.3)(yaml@2.7.0)) + starlight-sidebar-topics@0.3.0(@astrojs/starlight@0.31.0(astro@5.1.6(@types/node@22.10.6)(jiti@2.4.2)(rollup@4.29.1)(typescript@5.7.3)(yaml@2.7.0))): + dependencies: + '@astrojs/starlight': 0.31.0(astro@5.1.6(@types/node@22.10.6)(jiti@2.4.2)(rollup@4.29.1)(typescript@5.7.3)(yaml@2.7.0)) + std-env@3.8.0: {} stream-replace-string@2.0.0: {}