Feature Request: Multiple Sidebar Support #959
Replies: 15 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
Adding screenshots for clarity |
Beta Was this translation helpful? Give feedback.
-
I might add to this saying this might be the perfect opportunity to also add versioning, as this would basically be all it needs. Referring to issue #372. As versioning would also need a separate sidebar (docs??) instance. website
├── sidebars.json # sidebar for the current docs version
├── docs # docs directory for the current docs version
│ ├── foo
│ │ └── bar.md # https://mysite.com/docs/next/foo/bar
│ └── hello.md # https://mysite.com/docs/next/hello
├── versions.json # file to indicate what versions are available
├── versioned_docs
│ ├── version-1.1.0
│ │ ├── foo
│ │ │ └── bar.md # https://mysite.com/docs/foo/bar
│ │ └── hello.md
│ └── version-1.0.0
│ ├── foo
│ │ └── bar.md # https://mysite.com/docs/1.0.0/foo/bar
│ └── hello.md
├── versioned_sidebars
│ ├── version-1.1.0-sidebars.json
│ └── version-1.0.0-sidebars.json
├── docusaurus.config.js
└── package.json (structure from docusaurus) This could be adapted and used similar for starlight. |
Beta Was this translation helpful? Give feedback.
-
Just adding that we should explore other routes for generating sidebars and versioning instead of using a sidebars.json which I have found to be painful to use in large documentation just because of the large overhead of maintenance and the fact that most writers won't do the JSON editing. Some reasons Nextra will be moving from a _meta.json to a ts file are listed here shuding/nextra#852 |
Beta Was this translation helpful? Give feedback.
-
Just to show another approach: English "en" is the main language in the examples
The + indicates that this is a multi-language folder, you can colocate your translations inside, having everything in one place. With:
|
Beta Was this translation helpful? Give feedback.
-
I'm coming from docusaurus, multiple sidebars are very useful for large documentation sites, I have over 30 different sidebars in my docusaurus project. An example is a documentation site like https://developer.mozilla.org/en-US/docs/Web where multiple sidebars are needed. |
Beta Was this translation helpful? Give feedback.
-
For building large documentation sites this would be highly beneficial if it can be added. While that may not be the best way to do it, seems like simply allowing the various folders within the src/content folder to represent different state trees of docs i.e src/content/about |
Beta Was this translation helpful? Give feedback.
-
Just chiming in because the ability to specify a sidebar is critical for our project, and would block us migrating. I would advise decoupling this from the versioning discussion, because for certain structures this would be a complete solution. (I have a folder that's |
Beta Was this translation helpful? Give feedback.
-
I'm into same boat. My Hugo site is designed to accommodate multiple projects, each project having their own header and sidebar, pretty much like the official https://docs.astro.build work, the title adds the |
Beta Was this translation helpful? Give feedback.
-
Throwing my hat in the ring here, this is very much something I would like starlight to offer. |
Beta Was this translation helpful? Give feedback.
-
This is something I am really looking forward to as well. In our use case, as we are preparing user guide for admin and employee to use our system, and we will need to have different sidebar menus for different user type. |
Beta Was this translation helpful? Give feedback.
-
Also requesting this issue, would be really nice to have this docusaurus feature. |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
Just in case people missed it, the linked PR gives an example of how to get this to work pretty simply. Their example just needs to cut off the path so only the top-level segment is considered (what we want for our case): |
Beta Was this translation helpful? Give feedback.
-
Sharing another plugin based approach I made that allows to split documentation project into different sections, each with its own sidebar and landing page (and also supports external links): |
Beta Was this translation helpful? Give feedback.
-
What version of
starlight
are you using?0.9.0
What is your idea?
Add the support of multiple sidebar instances for better navigation.
Similar feature to what docusaurus currently provides, which basically allows you to assign specific sidebars to specific routes/endpoints and/or documents of your site.
Frontmatter (concept)
In your astro config you'd then define the sidebars like the way you did before but you add some kind of name/Identifier to it.
Why is this feature necessary?
Would be basically a QoL change which would allow users to structure their documentation better.
As Starlight (as of this date) doesn't have a navbar where users are able to freely navigate between routes it wouldn't be the most ideal thing to add (as of now) in my opinion.
Do you have examples of this feature in other projects?
Participation
Beta Was this translation helpful? Give feedback.
All reactions