feat: can add blog post in nav

This commit is contained in:
Hugo Poissonnet 2022-11-30 11:35:45 +01:00
parent 2da63237ee
commit 2f7a0351f1

View File

@ -11,8 +11,7 @@
{{ range .Site.Menus.nav }}
<li class="pattern">
{{ $active := or ($current.IsMenuCurrent "nav" .) ($current.HasMenuCurrent "nav" .) }}
{{ $active = or $active (eq .Name $current.Title) }}
{{ $active = or $active (and (eq .Name "Blog") (eq $current.Section "post")) }}
{{ $active = or $active (eq .URL $current.RelPermalink) }}
{{ $active = or $active (and (eq .Name "Tags") (eq $current.Section "tags")) }}
<a href="{{ .URL }}" {{ if $active }}aria-current="page"{{ end }}>
<svg class="bookmark-icon" aria-hidden="true" focusable="false" viewBox="0 0 40 50">
@ -23,4 +22,4 @@
</li>
{{ end }}
</ul>
</nav>
</nav>