1
0
Fork 0

add menu active class

This commit is contained in:
nanxiaobei 2021-08-21 04:05:36 +08:00
parent 7abe373063
commit 0532220ff3

View file

@ -92,8 +92,9 @@
{{ if site.Menus.main }}
<nav class="menu">
{{ $url := .URL }}
{{ range site.Menus.main }}
<a href="{{ .URL }}">{{ .Name }}</a>
<a class="{{ if eq $url .URL }}active{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</nav>
{{ end }}