Skip to content

Commit

Permalink
feat: match active class docs menu on identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
h-enk committed Feb 12, 2021
1 parent 4048e98 commit 7384cfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layouts/partials/sidebar/docs-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h3>{{ .Name }}</h3>
<ul class="list-unstyled">
{{ range .Children -}}
{{- $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>
{{ end -}}
</ul>
Expand Down

0 comments on commit 7384cfe

Please sign in to comment.