Allow specification of sidebar position/order for directories and nested directories #969
Replies: 4 comments
-
FYI I think this is similar/would be solved by: #370 as that would allow us to configure the directories via a config file in situ |
Beta Was this translation helpful? Give feedback.
-
Is there a workaround I can use for now? Or I should manually specify each sidebar item manually (ouch) :) |
Beta Was this translation helpful? Give feedback.
-
yeah, solving #370 would allow this submitter to position the entire directory via the frontmatter for the directory index pages and the sortOrder would then operate within that directory. I think that's what the submitter is describing as desired state. |
Beta Was this translation helpful? Give feedback.
-
a potential work around would be to pull the sidebar configuration out into a separate file that you include in the astro.config.cfg file. You could then generate the sidebar configuration as part of your site build step rather than using the built in autogenerate functionality. the inital cost is fairly high (to build the generator) but then the incremental cost (per page) is low. |
Beta Was this translation helpful? Give feedback.
-
What version of
starlight
are you using?0.6.1
What is your idea?
We are working on a longer form book: https://programmers.guide/book/part-0-getting-started/00-introduction/
We would like to specift the order/position in the sidebar for each menu item, including directories, as well as overriding the name of the sidebar title in in frontmatter of each dir/file so we wouldn't have to do it all centrally from the config file.
Why is this feature necessary?
With a large number of directories and files, managing centrally in the config file can become messy. Simply including a position index position in the frontmatter makes the ordering simpler for our use case
Do you have examples of this feature in other projects?
https://docusaurus.io/docs/next/sidebar/autogenerated#category-item-metadata
Participation
Beta Was this translation helpful? Give feedback.
All reactions