2018-01-24 09:42:50 +00:00
|
|
|
<div>
|
|
|
|
<ul class="sidebar-nav">
|
2018-07-16 03:22:00 +00:00
|
|
|
{{ $currentPage := . }}
|
|
|
|
{{- range .Site.Menus.main -}}
|
2018-01-24 09:42:50 +00:00
|
|
|
{{ if .HasChildren -}}
|
2018-07-16 03:22:00 +00:00
|
|
|
<li {{ if $currentPage.HasMenuCurrent "main" . }}class="active"{{ end }}>
|
|
|
|
<a href="#">{{ .Pre }}
|
|
|
|
<span>{{ .Name }}</span>
|
|
|
|
</a>
|
2018-01-24 09:42:50 +00:00
|
|
|
<ul class="sidebar-nav">
|
2018-07-10 01:41:30 +00:00
|
|
|
{{- range .Children -}}
|
2018-07-16 03:22:00 +00:00
|
|
|
<li {{ if $currentPage.IsMenuCurrent "main" . }}class="active"{{ end }}>
|
|
|
|
<a href="{{ .URL }}">{{ .Name | title }}</a>
|
|
|
|
</li>
|
2018-01-24 09:42:50 +00:00
|
|
|
{{- end -}}
|
|
|
|
</ul>
|
2018-07-16 03:22:00 +00:00
|
|
|
{{- else -}} <!-- No children -->
|
2018-01-24 09:42:50 +00:00
|
|
|
<li>
|
2018-07-16 03:22:00 +00:00
|
|
|
<a href="{{.URL}}">{{ .Pre }}
|
|
|
|
<span>{{ .Name | title }}</span>
|
|
|
|
</a>
|
2018-01-24 09:42:50 +00:00
|
|
|
</li>
|
2018-07-16 03:22:00 +00:00
|
|
|
{{- end -}}
|
2018-01-24 09:42:50 +00:00
|
|
|
{{- end }}
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|