From 7e792cab721aec4a82341e58a06b15c3f9046e8f Mon Sep 17 00:00:00 2001 From: Sarah Jones Date: Wed, 27 Nov 2024 08:50:03 +0200 Subject: [PATCH] chore: removed Glossary page's overview section (#3136) --- 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; +--- + +