Provide generated sidebar entries to custom pages #2146
Replies: 2 comments 2 replies
-
Thanks again for flagging this @KianNH! @HiDeoo what do you think about supporting the same config shape for the |
Beta Was this translation helpful? Give feedback.
-
Starting with Starlight This change simplifies the definition of sidebar items in the |
Beta Was this translation helpful? Give feedback.
-
What version of
starlight
are you using?0.25.2
What is your idea?
Provide generated sidebar entries, like how
Astro.props.sidebar
functions on overridden components, to custom pages (or more?).Why is this feature necessary?
When using the
StarlightPage
component, you can pass asidebar
prop with entries but have no way of grabbing the current entries to filter or append to.It was an use-case from the Discord to append entries to the sidebar, i.e blog posts on a
/src/pages/blog.astro
page.Unfortunately, even if the sidebar config is imported into the custom page then the shapes differ (i.e
{ label: string, link: string }
vs{ type: "link", label: string, href: string, ... }
) and won't pass validation.Do you have examples of this feature in other projects?
No response
Participation
Beta Was this translation helpful? Give feedback.
All reactions