Restructures the templates

This commit is contained in:
Huy Tran 2018-07-10 11:41:30 +10:00
parent 6b929ff8e0
commit f4aa888a5c
14 changed files with 108 additions and 128 deletions

View file

@ -0,0 +1,23 @@
<div>
<ul class="sidebar-nav">
{{ $currentPage := . }}
{{- range .Site.Menus.main -}}
{{ if .HasChildren -}}
<li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
<a href="#">{{ .Pre }}<span>{{ .Name }}</span></a>
<ul class="sidebar-nav">
{{- range .Children -}}
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
<a href="{{ .URL }}">{{ .Name | title }}</a>
</li>
{{- end -}}
</ul>
{{- else -}}
<li>
<a href="{{.URL}}">{{ .Pre }} <span>{{ .Name | title }}</span></a>
</li>
{{- end -}}
{{- end }}
</li>
</ul>
</div>