Additional configuration for previous / next labels - similar to sidebar: label: #3413
ianbale
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What version of
starlightare you using?0.35.2
What is your idea?
I'd like to be able to override the label in the previous / next buttons on OTHER pages. ie. the page before and the page after the current one.
I have 4 pages with titles:
"Engine, Overview"
"Engine, more detail"
"Gear Box, Overview"
"Gear Box, more detail"
Which would normally give me a side bar like this.
Engine
Engine, Overview
Engine , More detail
Gearbox
Gearbox, Overview
Gearbox, More detail
I don't like Engine and Gearbox being repeated for the pages. The section titles are enough, so I configure frontmatter to change my sidebar labels to Overview and More detail. Now my sidebar looks great:
Engine
Overview
More detail
Gearbox
Overview
More detail
However, this also changes the labels on the prev/next buttons. So, for example, if I am on the Engine, More Detail page, my prev button has the label Overview (which is OK - it's the same section, so I am cool with that), and my next button also has label Overview which is not... I'd like it to have the label Gearbox Overview... so it is clear that next is taking me to a new section and not as it is now, seemingly pointing to the same page title as the previous button.
I can see that I am able to add next: label: to this page to set the label on the next button. But this is creates an unwanted link between this page and the next one which is bad. What if I decide to add another page later that sits between my Engine More Detail, and the Gearbox Overview? My next label is no longer correct. I need to remember to edit Engine, More Detail page and change the next: label: to reflect the next page.
What I want to do instead is configure something in Gearbox, Overview page so that whatever page I place immediately prior to it will have some specific text, and not the sidebar: label: text. ie. I want to specify what "this page" looks like in other pages "prev/next" buttons just as I can dictate what it looks like in the sidebar.
Why is this feature necessary?
It is not strictly necessary since there is a workaround to edit the previous and next pages frontmatter rather than than th page to which my requirement applies.
However, this would be a significant improvement in terms of site maintenance, particularly when coming back to update a site that may have been built some time ago - or by someone else, where it may not be obvious that the labels for this page have been overridden on other pages.
I suppose an alternative way to look at this is that I'd like a way to configure the prev/next buttons so that instead of just have the sidebar label, I can also have the section title if I would be navigating too a new section.
So maybe that is a better feature to request...? I guess that would be a site wide configuration option...
Do you have examples of this feature in other projects?
No response
Participation
Beta Was this translation helpful? Give feedback.
All reactions