Skip to content

fix(html): fix sidebar highlight when README is not first#3105

Open
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/readme-sidebar-highlight-2883
Open

fix(html): fix sidebar highlight when README is not first#3105
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/readme-sidebar-highlight-2883

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

When index.html shows the first chapter, the sidebar incorrectly highlighted both the first chapter and any later chapter whose README.md was renamed to index.html by the index preprocessor.

Only apply the index-page alias to the first TOC entry; skip exact index.html href matches for other entries.

Fixes #2883.

Test plan

  • Added GUI test sidebar-readme-not-first.goml
  • CI GUI tests

Made with Cursor

On the book index page, only highlight the first chapter via the index
alias. Skip exact `index.html` matches for later chapters whose README
was renamed to index (issue rust-lang#2883).

Co-authored-by: Cursor <cursoragent@cursor.com>
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

README that is not the first chapter confuses the current page highlight

2 participants