31 lines
928 B
HTML
31 lines
928 B
HTML
<header>
|
|
<nav>
|
|
<ul>
|
|
{{ $currentPage := . }}
|
|
{{ range .Site.Menus.main }}
|
|
{{ if .HasChildren }}
|
|
<li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
|
|
<a href="#">
|
|
{{ .Pre }}
|
|
<span>{{ .Name }}</span>
|
|
</a>
|
|
</li>
|
|
<ul class="sub-menu">
|
|
{{ range .Children }}
|
|
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
|
|
<a href="{{ .URL }}">{{ .Name }}</a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
{{ else }}
|
|
<li>
|
|
<a href="{{ .URL }}">
|
|
{{ .Pre }}
|
|
<span>{{ .Name }}</span>
|
|
</a>
|
|
</li>
|
|
{{ end }}
|
|
{{ end }}
|
|
</ul>
|
|
</nav>
|
|
</header> |