Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Top navigation hover/active highlight #11

Open
torieketcham opened this issue Apr 21, 2021 · 2 comments
Open

Top navigation hover/active highlight #11

torieketcham opened this issue Apr 21, 2021 · 2 comments

Comments

@torieketcham
Copy link
Collaborator

Is there a way to configure the elements in the top navigation so that they are highlighted on hover as well as when a user is on a given page? This currently only works for the pages that were bundled in the template (i.e. publications) but not for new pages that I have created. I've attached some screenshots below.

1

2

@7yl4r
Copy link
Member

7yl4r commented Apr 24, 2021

This is not available as an easy setting.
Possible menu settings are here:

# Main menu alignment (l = left, c = center, r = right) and logo options.
main_menu = {
  enable = true, 
  align = "l", 
  show_logo = true, 
  highlight_active_link = true, 
  show_language = false, 
  show_day_night = true, 
  show_search = true
}

The relevant line in wowchemy modules is:

https://github.com/wowchemy/wowchemy-hugo-modules/blob/fda9f39d872ec066b4f11a9c68b85aac2163bf75/wowchemy/layouts/partials/navbar.html#L108

The fix is to add something that adds the active class to (jquery syntax) a .nav-item.
Probably some javascript that uses onhover() - although I think newer CSS can do this and would be cleaner.

We could open this as an issue in wowchemy-hugo-modules and I can submit a pull request if others there want it.

@torieketcham
Copy link
Collaborator Author

How much effort would that involve on your part? If a lot, then maybe the alternative is to remove highlighting altogether?

@7yl4r 7yl4r removed their assignment Jan 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants