blob: ee32bbe9ed98e55dbbdc26fe88c92cc41b4f8cb8 (
plain)
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
52
|
{{ define "main" }}
{{ range .Site.RegularPages.ByWeight.Reverse }}
{{ $tmp := .Content }}
{{ end }}
{{ range .Site.RegularPages }}
{{ .Content }}
{{ end }}
{{ end }}
{{ define "toc" }}
<ul id="toc" class="toc-list-h1">
{{ $maxDepth := 0 }}
{{ with $.Site.Params.maxMenuDepth }}
{{ $maxDepth = . }}
{{ else }}
{{ $maxDepth = 2 }}
{{ end }}
{{ $headers := slice }}
{{ with .Site.RegularPages }}
{{ $headers = partial "funcs/toc_from_pages" . }}
{{ end }}
{{ range $headers }}
<li>
<a href="#{{ .id }}" class="toc-h{{ .level }} toc-link" data-title="{{ .title }}">
{{ .title }}
</a>
{{ if and (ge $maxDepth 2) .sub }}
<ul class="toc-list-h2">
{{ range .sub }}
<li>
<a href="#{{ .id }}" class="toc-h{{ .level }} toc-link" data-title="{{ .title }}">
{{ .title }}
</a>
{{ if and (ge $maxDepth 3) .sub }}
<ul class="toc-list-h3">
{{ range .sub }}
<li>
<a href="#{{ .id }}" class="toc-h{{ .level }} toc-link" data-title="{{ .title }}">
{{ .title }}
</a>
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
|