/
sidebar.html
51 lines (51 loc) · 1.44 KB
/
sidebar.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<aside class="docs-menu">
<h3>Menu</h3>
<ul>
{{ $currentPage := . }}
{{ range .Site.Menus.docs }}
{{ if .HasChildren }}
<li>
{{ if $currentPage.IsMenuCurrent "docs" . }}
<span class="active">{{ .Name }}</span>
{{ else }}
<a href="{{ .URL }}">
{{ .Pre }}
<span>{{ .Name }}</span>
</a>
{{ end }}
</li>
<ul class="sub-menu">
{{ range .Children }}
{{ if $currentPage.IsMenuCurrent "docs" . }}
<li class="active">
{{ .Pre }}
<span>{{ .Name }}</span>
</li>
{{ else }}
<li>
<a href="{{ .URL }}">
{{ .Pre }}
<span>{{ .Name }}</span>
</a>
</li>
{{ end }}
{{ end }}
</ul>
{{ else }}
{{ if $currentPage.IsMenuCurrent "docs" . }}
<li>
{{ .Pre }}
<span class="active">{{ .Name }}</span>
</li>
{{ else }}
<li>
<a href="{{ .URL }}">
{{ .Pre }}
<span>{{ .Name }}</span>
</a>
</li>
{{ end }}
{{ end }}
{{ end }}
</ul>
</aside>