🐛 Bug: Navbar Active State Not Highlighting "Docs" and "Specification" on Related Pages
Describe the bug
Currently, the navbar does not highlight "Docs" or "Specification" as active when visiting pages related to specifications or documentation. This happens because the URL structure does not always contain /docs or /specification, making the active state logic ineffective.
This is little bit related to issue #1375 where previously the navbar was not active on tooling page. After fixing its working on both blogs and tooling page.
Steps To Reproduce
- Go to https://json-schema.org/draft/2019-09 (or any specification page).
- Notice that the "Specification" tab in the navbar is not highlighted as active.
- Similarly, visit any documentation-related page that does not contain /docs directly in the URL.
- The "Docs" tab does not show as active.
Expected Behavior
The "Specification" tab should be active when viewing any specification-related page (e.g., /draft/*). The "Docs" tab should be active when viewing any documentation-related page.
Screenshots
Device Information [optional]
- OS:Linux
- Browser: Firefox
- version:
Are you working on this issue?
Yes
Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)
Yes
Navbar before.
Navbar After.
@benjagm whats your thougts about this?
Go ahead. Thanks.
This is supposed to work as there is already an implementation for it, so please check this more in terms of bug than missing feature.
Hi @cbum-dev , this issue is already fixed with this https://github.com/json-schema-org/website/pull/1537 PR , so I think we can close this as completed. Thank you !