From 6e9b41f5650760cf63903bd119b2d16b687b59d8 Mon Sep 17 00:00:00 2001 From: JoblersTune Date: Tue, 26 Nov 2024 15:37:18 +0200 Subject: [PATCH] chore: removed Glossary page's overview section --- packages/documentation/astro.config.mjs | 3 ++- .../src/components/PageSidebar.astro | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 packages/documentation/src/components/PageSidebar.astro diff --git a/packages/documentation/astro.config.mjs b/packages/documentation/astro.config.mjs index 9041f10dec..6fcebb9397 100644 --- a/packages/documentation/astro.config.mjs +++ b/packages/documentation/astro.config.mjs @@ -42,7 +42,8 @@ export default defineConfig({ } }, components: { - Header: './src/components/Header.astro' + Header: './src/components/Header.astro', + PageSidebar: './src/components/PageSidebar.astro' }, head: [ { diff --git a/packages/documentation/src/components/PageSidebar.astro b/packages/documentation/src/components/PageSidebar.astro new file mode 100644 index 0000000000..7aab205456 --- /dev/null +++ b/packages/documentation/src/components/PageSidebar.astro @@ -0,0 +1,17 @@ +--- +import type { Props } from '@astrojs/starlight/props'; +import Default from '@astrojs/starlight/components/PageSidebar.astro'; + +const removeOverview = [ + 'resources/glossary', +] +const noOverview = removeOverview.includes(Astro.props.slug); +const toc = noOverview && Astro.props.toc !== undefined + ? { + ...Astro.props.toc, + items: Astro.props.toc?.items.slice(1), + } + : Astro.props.toc; +--- + +