Updated for how sections work in Hugo v0.23.
This commit is contained in:
parent
4047401c37
commit
5515bae2cc
1 changed files with 11 additions and 17 deletions
|
|
@ -5,14 +5,11 @@
|
|||
<h2 class="visually-hidden">Main menu</h2>
|
||||
<ul class="navbar clearfix">
|
||||
<li><a class="{{ if .IsHome }}active{{ end }}" href="/">Home</a></li>
|
||||
{{ range $section, $taxonomy := .Site.Sections -}}
|
||||
{{ if eq $section "" -}}
|
||||
{{ range $taxonomy.Pages -}}
|
||||
<li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
<li><a class="{{ if eq $currentSection $section }}active{{ end }}" href="/{{ urlize $section }}">{{ humanize $section }}</a></li>
|
||||
{{ range after 1 (where .Site.Pages "Section" "") -}}
|
||||
<li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
{{ range $.Site.Home.Sections -}}
|
||||
<li><a class="{{ if eq $currentSection .Section }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
|
|||
Loading…
Reference in a new issue