Replace deprecated variables .Hugo and .UniqueID with hugo and .File.UniqueID.

This commit is contained in:
Fredrik Jonsson 2019-06-05 11:45:38 +02:00
commit 6907412c20

View file

@ -1,11 +1,13 @@
{{ $currentID := .UniqueID }}
{{ $currentSection := .Section -}}
{{ $currentID := "" -}}
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
<aside class="sidebar layout__second-sidebar">
{{ range $.Site.Home.Sections -}}
<section>
<h4 class="menu"><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></h4>
<h4 class="menu"><a class="{{ if eq $currentSection .Section }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></h4>
<ul class="menu">
{{ range .Pages -}}
<li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
<li><a class="{{ if eq $currentID .File.UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end -}}
</ul>
</section>