Skip to content

Commit

Permalink
Add custom PageSidebar override
Browse files Browse the repository at this point in the history
  • Loading branch information
huijing committed Apr 1, 2024
1 parent f946c84 commit 45898b3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default defineConfig({
},
components: {
Header: './src/components/docs/Header.astro',
PageSidebar: './src/components/docs/PageSidebar.astro',
},
social: {
github: 'https://github.com/WICG/webmonetization',
Expand Down
17 changes: 17 additions & 0 deletions src/components/docs/PageSidebar.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
import type { Props } from '@astrojs/starlight/props';
import Default from '@astrojs/starlight/components/PageSidebar.astro';
const removeOverview = [
'docs/resources/glossary'
]
const noOverview = removeOverview.includes(Astro.props.slug);
const toc = noOverview
? {
...Astro.props.toc,
items: Astro.props.toc?.items.slice(1),
}
: Astro.props.toc;
---

<Default {...Astro.props} {toc}><slot /></Default>

0 comments on commit 45898b3

Please sign in to comment.