Skip to content

How can I reuse the sidebar navigation in a place that isn't the sidebar? #1673

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

You must be logged in to vote

👋 Thanks for your question.

This is something that can be achieved using component overrides which allow you to replace the components used by Starlight with your own custom components. When overriding a Starlight component, your custom component receives a standard object (Astro.props) containing all the data for the current page (which includes the sidebar data)

In your specific case, one solution could be to override the <MarkdownContent/> component which is rendered around each page’s main content. If the page is the hompage, render something totally diferent that is re-using the sidebar data. If this is not, render the default MarkdownContent component from Starlight.

I tried to give…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@oliwarner
Comment options

@delucis
Comment options

Answer selected by oliwarner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants