Skip to content

Conversation

@qaqland
Copy link
Contributor

@qaqland qaqland commented Dec 24, 2025

Previously, the sidebar JavaScript logic for detecting the "active" page relied on URL and assumed it would end with .html. When using clean URLs without this suffix, this logic would fail to correctly highlight the current page in the sidebar.

This change moves the current page identification to server-side rendering by adding a data-current-link attribute to the HTML root element.

Fixes #2962

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Dec 24, 2025
@qaqland
Copy link
Contributor Author

qaqland commented Dec 24, 2025

Ref: #2570 and #2415

@qaqland qaqland force-pushed the current-page-active branch 2 times, most recently from bee3fca to 1404b89 Compare December 24, 2025 16:37
Previously, the sidebar JavaScript logic for detecting the "active" page
relied on URL and assumed it would end with .html. When using clean URLs
without this suffix, this logic would fail to correctly highlight the
current page in the sidebar.

This change moves the current page identification to server-side
rendering by adding a data-current-link attribute to the HTML root
element.

Fixes rust-lang#2962
@qaqland qaqland force-pushed the current-page-active branch from 1404b89 to 4d0d4e5 Compare January 4, 2026 08:40
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.

Section Headers not Displaying if '.html' Stripped from URL

2 participants