aboutsummaryrefslogtreecommitdiff
path: root/layouts/docs/list.html
blob: 03b37213e74f243df361097b8b0611516dd9e640 (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
{{ define "main" }}
  <div>
    <h1 class="title {{ if eq (len .Pages) 0 }}centered{{ end }}">
      {{ if .Params.heading }}{{ .Params.heading }}{{ else }}{{ .Title }}{{ end }}
    </h1>
    {{ if ne (len .Pages) 0 }}
      <p>{{ .Description }}</p>
    {{ end }}

    {{ .Content }}

    <ul class="range">
      {{ if ne (len .Sections) 0}}
        {{ range .Sections }}
          <li>
            <a href="{{ .RelPermalink }}">{{ .Title }}</a> - {{ .Description }}
            <ul class="range">
              <!-- Show pages under this section (but not subsections) -->
              {{ range (union .Sections .Pages).ByWeight }}
                <li>
                  <a href="{{ .RelPermalink }}">{{ .Title }}</a> - {{ .Description }}
                </li>
              {{ end }}
            </ul>
          </li>
        {{ end }}
      {{ else }}
        {{ range .RegularPages.ByWeight }}
          <li>
            <a href="{{ .RelPermalink }}">{{ .Title }}</a> - {{ .Description }}
          </li>
        {{ end }}
      {{ end }}
    </ul>
  </div>
{{ end }}