hugo-theme-hyde-hyde/layouts/partials/sidebar/menu.html

28 lines
667 B
HTML
Raw Permalink Normal View History

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 }}
{{ 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">
{{ 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>
{{ end }}
2018-01-24 09:42:50 +00:00
</ul>
2019-06-16 16:15:27 +00:00
</li>
{{ 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>
{{ end }}
{{ end }}
2018-01-24 09:42:50 +00:00
</ul>
</div>