Skip to content
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

feat: multiple sidebars support #687

Closed
wants to merge 3 commits into from
Closed

Conversation

scarf005
Copy link
Contributor

@scarf005 scarf005 commented Sep 8, 2023

What kind of changes does this PR include?

  • Changes to Starlight code

Description

navgroups-showcase.mp4

TODO

  • Update docs
  • Add E2E tests
  • handle base path

Help Needed

  • would there be a better way to make navbars more responsive?
  • header column width changes w/wo sidebars, but i was unable to find correct CSS equation to resolve the issue.
Without sidebar With sidebar
no-sidebar sidebar

@netlify
Copy link

netlify bot commented Sep 8, 2023

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 8633fd4
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/64fd91ce03df9600083bc17a
😎 Deploy Preview https://deploy-preview-687--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@changeset-bot
Copy link

changeset-bot bot commented Sep 8, 2023

🦋 Changeset detected

Latest commit: 8633fd4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Minor

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

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Sep 8, 2023
@delucis
Copy link
Member

delucis commented Sep 14, 2023

Thanks for trying to tackle this @scarf005! There’s a lot of considerations going into how to implement a feature that has as a big an impact as this one. It might be best to spend some time discussing what an API should look like and all the ways it interacts with different parts of how Starlight works to make sure we understand all the use cases and implications.

I’d suggest we discuss in #658 first, before looking at implementing anything, so that we don’t risk sinking too much time into building code that might not end up being the solution we go for. Still appreciate you trying to figure this out though!

@scarf005
Copy link
Contributor Author

I see, thanks for the consideration. opening it as it's mostly 'feature complete' and could spark some ideas.

@scarf005 scarf005 marked this pull request as ready for review September 18, 2023 04:33
@delucis
Copy link
Member

delucis commented Feb 9, 2024

Closing as it is now somewhat stale and our component overrides system offers some workarounds while we figure out the bigger picture. Thanks again for the PR!

@delucis delucis closed this Feb 9, 2024
@asturur
Copy link

asturur commented Mar 22, 2024

Do you have any example on how the component ovverides let me achieve multiple sidebars?

@delucis
Copy link
Member

delucis commented Apr 8, 2024

@asturur Here’s one example of using the URL of the current page to filter the sidebar for different products: https://stackblitz.com/edit/github-dubgkv?file=src%2Foverrides%2FSidebar.astro

@p-dg
Copy link

p-dg commented Apr 26, 2024

@delucis Thanks for your example. I am a designer playing around with starlight, trying to implement customized sidebars per route. Your example helps, but Pagination and your styling example only work on the first level ob the subdirectory.
So styling for product-2 and Pagination works on
/product-2/[index] but not on succeeding pages, for example
/product-2/set-up
Can you provide a working example for subpages / subdirectories? Thanks in advance!

@carcigenicate
Copy link

carcigenicate commented Aug 14, 2024

@p-dg

I figured it out in case you're still interested. All you need to do is change the definition of currentBase in their example:

const currentBase = `/${Astro.url.pathname.split('/')[1]}`;

Now, it only considers the first segment in the path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Multiple Sidebar Support
5 participants