2018-01-24 09:42:50 +00:00
|
|
|
<div>
|
|
|
|
<ul class="sidebar-nav">
|
2018-07-16 03:22:00 +00:00
|
|
|
{{ $currentPage := . }}
|
2018-07-29 21:41:49 +00:00
|
|
|
{{ range .Site.Menus.main }}
|
|
|
|
{{ 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-29 21:41:49 +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-07-29 21:41:49 +00:00
|
|
|
{{ end }}
|
2018-01-24 09:42:50 +00:00
|
|
|
</ul>
|
2018-07-29 21:41:49 +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-29 21:41:49 +00:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2018-01-24 09:42:50 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|