Gain access to the generated Sidebar config for non-Sidebar usage #2750
brian-montgomery
started this conversation in
Feature Requests
Replies: 1 comment 2 replies
-
Thanks for describing your use case 🙌 This is indeed one that would be unlocked by this PR. In any Astro component, even the one rendered inside a custom The API is not yet finalized and it's currently a work in progress, but this should look like accessing something like |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What version of
starlight
are you using?0.30.3
What is your idea?
I want to create a splash page that uses the generated
<Sidebar>
navigation data structure (complete with internationalization support) as a "table of contents" on a landing page. This is similar to #2146, only the generated configuration is not available for slots when the<StarlightPage>
generates it.Another use case is re-using this same structure in a customized navigation menu on a webpage sitting "outside" the documentation section of the site. If #959 is implemented, having access to subsections would also be helpful.
I submitted a PR for exposing the necessary
navigation
functions, but that was rejected.Why is this feature necessary?
The
"sidebar"
configuration is a great way to autogenerate a navigation structure for the entire project, especially when internationalization is included. Unfortunately, the generated data structure (SidebarEntry[]
) and functions (that convertSidebarItem[]
toSidebarEntry[]
are completely limited to the<Sidebar>
component and developers have to currently recreate all of that functionality to do something custom with that generated sidebar navigation structure.Do you have examples of this feature in other projects?
Participation
Beta Was this translation helpful? Give feedback.
All reactions