Welcome to mirror list, hosted at ThFree Co, Russian Federation.

list.html « _default « layouts - github.com/bep/docuapi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 23cb5961f43e3e4c8c612926343402945d6a984c (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
{{ define "main" }}
    {{ 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 }}