Skip to content

Hide Overview heading in page-level TOC? #1675

Closed Answered by HiDeoo
melissahenderson asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the question!

There isn't a built-in way to hide the Overview heading from the TOC. However, this is something you can achieve using component overrides which is a feature that let you replace the default components used by Starlight with your own custom components.

The idea would work like this:

  • Add a component override for the PageSidebar component which is responsible for rendering the table of contents.
  • In the custom PageSidebar component, re-use the built-in PageSidebar component so that you don't have to re-implement the entire table of contents.
  • Only when on the glossary page, filter out the Overview heading from the table of contents.

Such a component override would l…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by melissahenderson
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants