add new layers

This commit is contained in:
loikein 2023-04-24 02:16:28 +01:00
parent 947a89b641
commit b3c260bccf
3 changed files with 85 additions and 0 deletions

35
layouts/book/all.html Normal file
View file

@ -0,0 +1,35 @@
{{ define "main" }}
<div id="layout">
<article>
{{ partial "brand.html" . }}
{{ partial "content.header.html" . }}
<!-- https://discourse.gohugo.io/t/how-to-build-one-collection-for-all-nested-sections/27950/5 -->
{{ with .Content }}
<section>
{{ . }}
</section>
{{ end }}
<section class="list-page">
{{ $indexScratch := .Scratch }}
{{ range .Sections }}
{{ $indexScratch.Add "sections" (slice . ) }}
{{ end }}
{{- range ($indexScratch.Get "sections").ByTitle -}}
<p><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>
<ul>
{{- range .Pages.ByTitle -}}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{- end -}}
</ul>
{{- end -}}
</section>
{{ partial "footer.html" . }}
</article>
</div>
{{ end }}

View file

@ -0,0 +1,25 @@
{{ define "main" }}
<div id="layout">
<article>
{{ partial "brand.html" . }}
{{ partial "content.header.html" . }}
<section class="list-page">
<ul>
{{ range .Pages.ByTitle }}
{{ if .IsPage }}
<li><a href="{{ .RelPermalink }}">{{.Title}}</a></li>
{{ end }}
{{ end }}
</ul>
</section>
{{ partial "footer.html" . }}
</article>
</div>
{{ end }}

25
layouts/book/volumes.html Normal file
View file

@ -0,0 +1,25 @@
{{ define "main" }}
<div id="layout">
<article>
{{ partial "brand.html" . }}
{{ partial "content.header.html" . }}
<section class="list-page">
<ul>
{{ range .Pages.ByTitle }}
{{ if .IsSection }}
<li><a href="{{ .RelPermalink }}">{{.Title}}</a></li>
{{ end }}
{{ end }}
</ul>
</section>
{{ partial "footer.html" . }}
</article>
</div>
{{ end }}