Using the Menu for Lazy Bloggers and set an active class for all of my navigation and see the active link when I click on an item… But when it comes to taxonomy it does not show the .active
class.
So if I visit: http://localhost:1313/blog/
the blog
link is active
, but if I click on a taxonomy term like news: http://localhost:1313/blog/news/
the link is no longer active, even if the term is under blog
?!
header.html:
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<a class="{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}active{{end}}" href="{{.URL}}">{{ .Name }}</a>
{{ end }}
config.toml
[menu.main]]
name = "Home"
weight = 1
identifier = "home"
url = "/"
[[menu.main]]
name = "Blog"
weight = 2
identifier = "blog"
url = "/blog/"
single.html
{{ with .Params.blog }}
<a href="/blog{{ . | urlize | relLangURL }}">{{ . }}</a>
{{ end }}