2016-03-17 12:01:39 +01:00
< nav id = "sidebar" >
< div id = "header-wrapper" >
< div id = "header" >
{{ partial "logo.html" . }}
< / div >
2016-10-25 00:45:15 +02:00
{{ if .Site.Params.search }}
{{ partial "search.html" . }}
{{ end }}
2016-03-25 11:53:03 +01:00
< / div >
2016-03-17 12:01:39 +01:00
2016-03-25 11:53:03 +01:00
< div class = "highlightable" >
< ul class = "topics" >
{{ $page := . }}
2017-03-14 02:10:33 +03:00
{{ if $.Site.Params.menu }}
{{ $.Scratch.Set "menuItems" $.Site.Params.menu }}
{{ else }}
{{ $.Scratch.Set "_pages" (slice) }}
{{ range $key, $value := .Site.Sections }}
{{ $.Scratch.Add "_pages" ($.Site.GetPage "section" $key) }}
{{ end }}
{{ $.Scratch.Set "menuItems" (slice)}}
{{ range $key, $value := sort ($.Scratch.Get "_pages") "Weight" }}
{{ $.Scratch.Add "menuItems" $value.Section }}
{{ end }}
2016-10-14 09:30:59 +02:00
{{ end }}
{{ $menuItems := $.Scratch.Get "menuItems" }}
{{ range $i, $key := $menuItems }}
2016-03-25 11:53:03 +01:00
{{ if ne $key "" }}
2016-10-14 09:30:59 +02:00
2017-03-14 01:07:40 +03:00
{{ $value := (index $page.Site.Sections $key) }}
2017-03-14 02:10:33 +03:00
{{ $.Scratch.Set "_value" $value }}
2017-03-14 01:07:40 +03:00
{{ with $index := $.Site.GetPage "section" $key }}
2017-03-14 02:10:33 +03:00
{{ if .Content }}
2017-03-14 01:07:40 +03:00
{{ $.Scratch.Set "first" $index }}
{{ else }}
2017-03-14 02:10:33 +03:00
{{ $.Scratch.Set "first" (index $value 0).Page }}
2017-03-26 05:06:15 +03:00
{{ if gt $value.Len 1 }}
{{ $.Scratch.Set "_value" (after 1 $value) }}
{{ else }}
{{ $.Scratch.Set "_value" nil }}
{{ end }}
2017-03-14 01:07:40 +03:00
{{ end }}
2016-10-14 09:30:59 +02:00
{{ end }}
2017-03-14 01:07:40 +03:00
{{ $first := $.Scratch.Get "first" }}
2017-03-14 02:10:33 +03:00
{{ $value := $.Scratch.Get "_value" }}
2016-03-17 12:01:39 +01:00
2016-03-25 11:53:03 +01:00
< li class = "dd-item {{ if eq $page.RelPermalink $first.RelPermalink }}active{{ end }} {{if in $page.RelPermalink $first.RelPermalink }}parent{{ end }}" data-nav-id = "{{ $first.RelPermalink }}" >
< a href = "{{ $first.RelPermalink }}" >
< span >
{{ if isset $first.Params "icon" }}
{{ printf $first.Params.icon | safeHTML }}
2016-03-21 16:58:15 +01:00
{{ end }}
2016-03-25 11:53:03 +01:00
{{ $first.Title }}
2016-10-25 00:45:15 +02:00
{{ if $page.Site.Params.showVisitedLinks}}
2016-05-23 21:18:57 +01:00
< i class = "fa fa-check read-icon" > < / i >
2016-05-24 15:08:53 +01:00
{{ end }}
2016-03-25 11:53:03 +01:00
< / span >
< / a >
2017-03-14 01:07:40 +03:00
{{ if gt $value.Len 0}}
2016-03-25 11:53:03 +01:00
< ul >
2016-10-14 09:30:59 +02:00
{{ range $k, $p := $value }}
< li class = "dd-item {{ if eq $page.RelPermalink $p.Page.RelPermalink }}active{{ end }}" data-nav-id = "{{ $p.Page.RelPermalink }}" >
< a href = "{{ $p.Page.RelPermalink }}" >
< span > {{ $p.Page.Title }} {{ if $page.Site.Params.showVisitedLinks}} < i class = "fa fa-check read-icon" > {{ end }} < / i > < / span >
2016-03-25 11:53:03 +01:00
< / a >
< / li >
2016-03-17 12:01:39 +01:00
{{ end }}
< / ul >
2016-03-25 11:53:03 +01:00
{{ end }}
< / li >
{{ end }}
{{ end }}
< / ul >
< hr >
2016-10-25 00:45:15 +02:00
{{ if .Site.Params.showVisitedLinks}}
2016-05-23 21:18:57 +01:00
< a class = "padding" href = "#" data-clear-history-toggle = "" > < i class = "fa fa-fw fa-history" > < / i > Clear History< / a >
2016-10-25 00:45:15 +02:00
{{ end }}
2016-03-25 11:53:03 +01:00
< section id = "footer" >
2017-02-27 15:01:50 +01:00
{{ partial "menu-footer.html" . }}
2016-03-25 11:53:03 +01:00
< / section >
2016-03-17 12:01:39 +01:00
< / div >
< / nav >