Page breaks

This commit is contained in:
David Eisinger
2025-01-09 15:56:05 -05:00
parent bd969de994
commit 80e6e1b4da
2 changed files with 20 additions and 6 deletions

View File

@@ -238,4 +238,18 @@ audio::-webkit-media-controls-panel {
content: " (" attr(href) ")"; content: " (" attr(href) ")";
font-size: 0.8em; font-size: 0.8em;
} }
h2,
h3,
hr {
page-break-after: avoid;
}
li {
page-break-inside: avoid;
}
.page-break {
page-break-after: always;
}
} }

View File

@@ -1,10 +1,12 @@
{{ define "main" }} {{ define "main" }}
<section> <section>
{{ .Content }} {{ .Content }}
</section>
{{ range (sort (.Site.RegularPages.RelatedTo (keyVals "tags" "dispatch")) "Date" "asc") }} {{ range (sort (.Site.RegularPages.RelatedTo (keyVals "tags" "dispatch")) "Date" "asc") }}
{{ $page := . }} {{ $page := . }}
<section class="page-break">
<h2> <h2>
{{ .Title }} {{ .Title }}
</h2> </h2>
@@ -15,8 +17,6 @@
{{ $audioLink := printf "<a href=\"%s$1\">$3</a>" (substr .Site.BaseURL 0 -1) }} {{ $audioLink := printf "<a href=\"%s$1\">$3</a>" (substr .Site.BaseURL 0 -1) }}
{{ replaceRE `<audio controls src="((.*)/(.*).mp3)"></audio>` $audioLink .Content | safeHTML }} {{ replaceRE `<audio controls src="((.*)/(.*).mp3)"></audio>` $audioLink .Content | safeHTML }}
</section>
<div style="page-break-after: always"></div> {{ end }}
{{ end }}
</section>
{{ end }} {{ end }}