Does anybody have a working example of IsMenuCurrent and HasMenuCurrent?

I used every guide I found starting from docs to all guides on internet. Nothing works. Used latest hugo 124

If someone has workng example, please share.

p.s. I used $active = (eq $currentPage.RelPermalink .URL) but this is good only for single highlight. I need to highlight parent if child is current.

okay. This will work only if menu has pageRef.

/close

That is correct. Per the documentation:

Each menu entry defined in site configuration requires two or more properties:

  • Specify name and pageRef for internal links
  • Specify name and url for external links

Despite this documentation and several examples, site and theme authors continue to use url instead of pageRef for internal links. I’ve been trying to change this behavior, unsuccessfully, since the release of v0.86.0 in 2021.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.