-
Notifications
You must be signed in to change notification settings - Fork 1
/
header.html
23 lines (23 loc) · 1.06 KB
/
header.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"></button>
<a class="brand" href="{{ .Site.BaseURL }}">{{ .Site.Params.title }}</a>
<div class="nav-collapse collapse">
<ul class="nav"> {{ $currentPage := . }}{{ range .Site.Menus.main }}{{ if .HasChildren }}
<li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
<a href="#">{{ .Pre }}{{ .Name | safeHTML }}{{ .Post }}</a>
</li>
<ul class="sub-menu"> {{ range .Children }}
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
<a href="{{ .URL | safeHTML }}">{{ .Name | safeHTML }}</a>
</li> {{ end }}
</ul> {{ else }}
<li>
<a href="{{ .URL | safeHTML }}">{{ .Pre }}{{ .Name | safeHTML }}{{ .Post }}</a>
</li> {{ end }}{{ end }}
</ul>
</div>
</div>
</div>
</nav>