-
-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Starlight sidebar
user-config format for <StarlightPage />
sidebar
prop
#2168
Use Starlight sidebar
user-config format for <StarlightPage />
sidebar
prop
#2168
Conversation
🦋 Changeset detectedLatest commit: b569fd2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh boy, the code is so much simpler, not sure why we didn’t think to do it to begin with 😁
Looks good to me — I think you can remove the test files. Also needs a changeset explaining how to migrate if you’re using <StarlightPage>
.
Yeah, I had the exact same thought when working on the changes, not sure why either 😅 I've removed the test pages and added a changeset (altho, not super happy with it, tried to use a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the examples are good here! Yes, it’s big, but I agree this is clear (I also quickly tried a diff but it feels more confusing than helpful).
Description
This PR changes the data accepted by the
sidebar
prop of the<StarlightPage />
component used by custom routes.With this change, the
sidebar
prop can now accept a sidebar configuration identical to the one used by thesidebar
Starlight configuration.A few demo custom pages have been temporarily added to the docs to play around with the changes.
Remaining task
docs/astro.config.mjs
docs/src/pages/test-1.astro
docs/src/pages/test-2.astro
docs/src/pages/test-[index].astro
Idea
Could be worth maybe adding a new example to https://starlight-examples.netlify.app/ showing how to re-use a sidebar configuration between the Starlight configuration and a custom page where the custom page appends a few more items to the sidebar.