hugo-tufte/layouts/book/all.html

48 lines
1,022 B
HTML
Raw Normal View History

2023-04-24 03:16:28 +02:00
{{ define "main" }}
<div id="layout">
<article>
2023-04-29 06:18:01 +02:00
{{- partial "content.header.html" . -}}
2023-04-24 03:16:28 +02:00
<!-- https://discourse.gohugo.io/t/how-to-build-one-collection-for-all-nested-sections/27950/5 -->
2023-04-29 06:18:01 +02:00
{{- with .Content -}}
2023-04-24 03:16:28 +02:00
<section>
{{ . }}
</section>
2023-04-29 06:18:01 +02:00
{{- end -}}
2023-04-24 03:16:28 +02:00
<section class="list-page">
<!-- preambles -->
<ul>
{{ range .Pages.ByTitle }}
{{ if .IsPage }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
{{ end }}
{{ end }}
</ul>
<!-- sub categories & pages -->
2023-04-24 03:16:28 +02:00
{{ $indexScratch := .Scratch }}
{{ range .Sections }}
{{ $indexScratch.Add "sections" (slice . ) }}
{{ end }}
{{- range ($indexScratch.Get "sections").ByTitle -}}
2023-04-25 16:19:09 +02:00
<p><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></p>
2023-04-24 03:16:28 +02:00
<ul>
{{- range .Pages.ByTitle -}}
2023-04-25 16:19:09 +02:00
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
2023-04-24 03:16:28 +02:00
{{- end -}}
</ul>
{{- end -}}
</section>
{{ partial "footer.html" . }}
2023-04-29 06:18:01 +02:00
{{ partial "nav.html" . }}
2023-04-24 03:16:28 +02:00
</article>
</div>
{{ end }}