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