Skip to content

Implement persistent underline for top-level site section in left side navigation#1373

Open
kennethyyoung wants to merge 10 commits intoprocessing:mainfrom
kennethyyoung:underline-navigation
Open

Implement persistent underline for top-level site section in left side navigation#1373
kennethyyoung wants to merge 10 commits intoprocessing:mainfrom
kennethyyoung:underline-navigation

Conversation

@kennethyyoung
Copy link
Copy Markdown

@kennethyyoung kennethyyoung commented Apr 27, 2026

Resolves #1303

Changes:
Implements a persistent underline for top-level navigation items (e.g., Reference, Examples, Tutorials). The underline remains active both on the top-level section page and while navigating through its sub-sections.

  • Added a new variable currentPath, derived from pathMinusLocal, in index.astro
  • Used .startsWith() to allow the underline to persist when the current path is a sub-section
  • Apply "current" to MainNavLinks to trigger the underline style
  • We are using the same linklabel style used in JumpToLinks.tsx. Updates to the underline style will change both the underline for top-level navigation and sub-section links.

PR Checklist

  • npm run lint passes
  • [Inline documentation] is included / updated
  • [Unit tests] are included/updated

Collaborative contribution from:
@kennethyyoung, @mikeng07, and @aaronalaman as part of the April 2026 CodeDay Microinternship.

@kennethyyoung kennethyyoung marked this pull request as ready for review April 27, 2026 19:23
@kennethyyoung kennethyyoung marked this pull request as draft April 27, 2026 19:23
@kennethyyoung kennethyyoung marked this pull request as ready for review May 1, 2026 09:55
@ksen0
Copy link
Copy Markdown
Member

ksen0 commented May 1, 2026

Great work, team, thanks! I appreciate the compactness of the fix. I have tested locally and the materials here work:

  • Contributor docs ✔️
  • Examples ✔️
  • Tutorials ✔️
  • Reference ✔️

However there is additional nesting in Community and About that loses the info:

  • /libraries/ should have Community underlined (also affects events)
  • /code-of-conduct/ should have About underlined (also affects access statement)
  • /education-resources/ should have Tutorials underlined (exception: if this is difficult to do or requires more than ~3 lines of code, I think this can be omitted. There is some ongoing discussion on moving this anyway, so please feel free to focus on the other parts if this requires too much of a workaround.)

cc @doradocodes @Nwakaego-Ego please feel free to test this out or share your thoughts too

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.

Consistent style for top-level site section in left side navigation

3 participants