Autogenerate label for sidebar links #1630
Replies: 3 comments 5 replies
-
Thank you for the suggest @apfelbox! I’ve actually been meaning to propose something like this for a while. I’d probably suggest a new entry shape for this instead of the current starlight({
sidebar: [
{ id: 'guides/css-and-tailwind' },
{ label: 'Astro', link: 'https://astro.build/' },
],
}) That would then indicate to Starlight that the We could still allow overriding the One step further would be to even support a shorthand for this form so you could provide just the starlight({
sidebar: [
'guides/css-and-tailwind',
{ label: 'Astro', link: 'https://astro.build/' },
],
}) That might help people who like the autogenerated sidebar but want easier control over ordering, or want to combine entries with external links etc. It reduces the boilerplate needed to move from autogeneration to listing the entries. |
Beta Was this translation helpful? Give feedback.
-
Having this would be so much better especially for i18n. The titles needing to be specified in the config AND the front matter for EACH locale is awkward. And translators often get confused why it isn’t updated correctly when they translate a page since they are focused on content and not code (I.e. the config) |
Beta Was this translation helpful? Give feedback.
-
Since Starlight |
Beta Was this translation helpful? Give feedback.
-
What version of
starlight
are you using?0.21.1
What is your idea?
Right now, due to the inability to customize folder/group labels and sorting, you need to build your sidebar manually in a large part.
It is annoying to also need to duplicate the page label: the page already has a title but the link in the sidebar needs a label as well.
Would be great, if
would be allowed and it would automatically fetch the title of the page as label by default.
Why is this feature necessary?
Building larger sidebars is pretty fragile right now, as you need to duplicate a lot of things: all the links and the titles as well. This can get messed up pretty quickly.
Do you have examples of this feature in other projects?
No response
Participation
Beta Was this translation helpful? Give feedback.
All reactions