feat: match active class docs menu on identifier
This commit is contained in:
parent
4048e98259
commit
7384cfe8f1
|
@ -5,7 +5,7 @@
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
{{ range .Children -}}
|
{{ range .Children -}}
|
||||||
{{- $active := or ($currentPage.IsMenuCurrent "docs" .) ($currentPage.HasMenuCurrent "docs" .) -}}
|
{{- $active := or ($currentPage.IsMenuCurrent "docs" .) ($currentPage.HasMenuCurrent "docs" .) -}}
|
||||||
{{- $active = or $active (eq .Name $currentPage.Title) -}}
|
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
|
||||||
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .URL | absURL }}">{{ .Name }}</a></li>
|
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .URL | absURL }}">{{ .Name }}</a></li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue