diff --git a/astro.config.mjs b/astro.config.mjs index 97fe9ab..c3a8b23 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -17,6 +17,7 @@ export default defineConfig({ plugins: [starlightLinksValidator()], components: { Header: "./src/components/Header.astro", + PageSidebar: './src/components/PageSidebar.astro' }, expressiveCode: { styleOverrides: { diff --git a/src/components/PageSidebar.astro b/src/components/PageSidebar.astro new file mode 100644 index 0000000..16d604c --- /dev/null +++ b/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 = [ + 'iana', +] +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; +--- + +