Active link not working on sub directories

I set up a menu in my config.toml, when I go to the url the active link displays properly, but if I go another level deeper it is no longer active.

I am using <a class="nav-link {{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL }}">{{ .Name }}</a>

How can I keep the /docs menu item active even when a page under /docs is active? ie /docs/get-started

Have a look at this topic and particularly this answer (if you want to set the active class dynamically).

This topic was automatically closed after 22 hours. New replies are no longer allowed.