Skip to content

Link the previous and next topic at the end of each docs topic - #27

Closed
madolson wants to merge 1 commit into
mainfrom
docs-prev-next
Closed

madolson wants to merge 1 commit into
mainfrom
docs-prev-next

Conversation

@madolson

Copy link
Copy Markdown
Owner

A docs topic page ends with no way to keep reading, so a reader working through the docs goes back to the menu after every page. This adds Previous and Next links at the end of each topic, in the order the docs menu lists them, crossing from the end of one section into the start of the next. Command pages don't get them.

First topic (introduction), before and after:

before
after

Middle topic (large-object-getting-started), before and after:

before
after

Last topic (history), before and after:

before
after

390px wide, before and after:

before
after

AI generated details

Decisions

Order is the menu's. Each section's landing page (the menu's "Overview"), then its topics, section after section. It's computed from the same nav_merged result the menu is rendered from (templates/docs-page.html:20), so module sections (Search, Large object) and module topics (bloomfilters, valkey-json, ldap, valkey-bundle) land where the menu shows them, and the two can't drift apart.

Section boundaries: cross. Stopping would dead-end the last page of 13 of the 14 sections. The breadcrumb already says which section you're in. Docusaurus, MkDocs Material and VitePress all cross without marking it.

Command reference: skipped. It's a list of 457 commands, not a page you read next. After valkey-bundle (end of Getting started) comes data-types. The Clients, Integrations and Valkey Admin menu links from valkey-io#742 come from config, not nav_merged, so they're skipped too.

First and last pages. introduction shows only Next, history only Previous. No wrap-around. Next stays on the right when it's alone.

Command pages: none. 457 pages with no reading order: alphabetical puts APPEND between ACL WHOAMI and ASKING. Someone on a command page is looking it up, not reading through, and the breadcrumb and the menu's command list under the related topic already link the topic and its sibling commands.

Titles are the topic's own front matter title, the same as its H1, not the shorter menu title. Menu titles like "Getting started" and "Configuration" (Large object, Search) only make sense under their section heading.

Topic not in the menu: no links, and its would-be neighbours skip it. Today all 84 topics are in the menu.

Implementation

  • nav_pager component, templates/macros/nav.html:230-271: flattens the menu, finds the page, renders the links. Called once at the end of the content, templates/docs-page.html:63.
  • .docs-pager, sass/_valkey.scss:2413-2464. Inside the content card under a 1px #d5d9ec rule (the menu's section divider). Padding, radius, #d1d9ff hover and #2054B2 focus outline are the menu links'. The label is #444, like the topic index descriptions. No new colors. Stacks below 768px.
  • Links carry rel="prev" and rel="next"; the block is a <nav aria-label="Previous and next topics">.

Testing

A Python script recomputes the order from nav.yml and modules-nav/*.yml independently of the templates, and checks the hrefs on every built page:

84 topics in reading order, 84 topic pages
duplicates in menu: none
topic pages not in the menu (no prev/next): none
checked 84 menu topics, 0 unlisted topics, command pages: 0 errors
first: introduction last: history

With faq removed from a scratch copy of nav.yml: faq has no pager and installation's Next is migration. Also built merged with valkey-io#742: same 84 of 84.

Not verified: hover and focus states visually (static headless screenshots only), and screen reader output.

Overlaps

For you to decide

  • Mark section crossings (e.g. "Next: Cluster")? Proposal: no, the titles already say where you're going.

This was generated by AI but verified, with love, by a human.

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
@madolson madolson added the needs-review Staged work waiting on madolson's review label Nov 17, 2026
@github-actions

Copy link
Copy Markdown

madolson added a commit that referenced this pull request Nov 17, 2026
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
@madolson

Copy link
Copy Markdown
Owner Author

Folded into #26.

@madolson madolson closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Staged work waiting on madolson's review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant