Skip to content

Manually link page next-prev across child borders #1985

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kissaki
Copy link
Contributor

@Kissaki Kissaki commented Jul 16, 2025

The previous and next navigation links at the bottom of the page get filled automatically by vuepress, sourced from the (locale-specific) sidebar configuration.

We define the sidebar through sections - which may be single page sections or a section with child pages.

Previously, the website did not guide the user through our book.

  • Section prev always linked to previous section, never previous sections last child if available
  • Section next never linked to first child of section, if available
  • First child did not offer a prev link
  • Last child did not offer a next link

I did not see documentation about customizing the auto-discover behavior, nor the sidebar structure dependency of the automatic determination. But page frontmatter can override the prev and next links.

As a fixup, overriding the automatic discovery from the sidebar, we manually set the prev and next links on section child borders. The link text matches the headline/sidebar, and the links the sidebar structure. Given that this is manual configuration, there's a risk of it eventually being missed and becoming outdated or wrong when structure changes are made.

I did not test. I don't have a local nodejs env.

Resolves #1818

The previous and next navigation links at the bottom of the page get filled automatically by vuepress, sourced from the (locale-specific) sidebar configuration.

We define the sidebar through sections - which may be single page sections or a section with child pages.

Previously, the website did not guide the user through our book.

* Section prev always linked to previous section, never previous sections last child if available
* Section next never linked to first child of section, if available
* First child did not offer a prev link
* Last child did not offer a next link

I did not see documentation about customizing the auto-discover behavior, nor the sidebar structure dependency of the automatic determination.
But page frontmatter can override the prev and next links.

As a fixup, overriding the automatic discovery from the sidebar, we manually set the prev and next links on section child borders.
The link text matches the headline/sidebar, and the links the sidebar structure. Given that this is manual configuration, there's a risk of it eventually being missed and becoming outdated or wrong when structure changes are made.

I did not test. I don't have a local nodejs env.

Resolves nushell#1818

* https://v1.vuepress.vuejs.org/theme/default-theme-config.html#prev-next-links
* https://v1.vuepress.vuejs.org/guide/i18n.html#default-theme-i18n-config
* https://ecosystem.vuejs.press/themes/default/frontmatter.html#prev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Book navigation Next link skips chapter contents resulting in confusing navigation.
1 participant