about summary refs log tree commit diff
path: root/layouts/partials/toc.html
blob: 607e7f01a7f7488265c3a8596ed8628fd0f011cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{{ $chapters := .Page.Pages }}
{{ range .Page.Translations }}
{{ $chapters = $chapters | lang.Merge .Pages }}
{{ end}}
<ol>
  {{ range sort $chapters "Weight" }}
  <li>
    {{ $fullTitle := .Title }}
    {{ with .Params.chapterName }}
      {{ $fullTitle = printf "%s – %s" $fullTitle . }}
    {{ end }}
    <a href="{{ .RelPermalink }}">{{ trim $fullTitle " " }}</a>
    {{ partial "post-info.html" . }}
    {{ if .IsSection}}
      {{ partial "toc.html" . }}
    {{ end }}
  </li>
  {{ end }}
</ol>