aboutsummaryrefslogtreecommitdiff
path: root/layouts/docs/list.html
blob: 998d504f3f8917b6add26c2f4500a6746583c12e (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" style="{{ if eq (len .Pages) 0 }}text-align: center;{{ 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 }}