davideisinger.com

My personal website
Log | Files | Refs | README

commit 80e6e1b4dae52772d5bc0dd1cac202db9912d0e7
parent bd969de994ee07273cfb57973edde736ee70d756
Author: David Eisinger <[email protected]>
Date:   Thu,  9 Jan 2025 15:56:05 -0500

Page breaks

Diffstat:
Mthemes/v2/assets/css/style.scss | 14++++++++++++++
Mthemes/v2/layouts/archive/list.html | 12++++++------
2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/themes/v2/assets/css/style.scss b/themes/v2/assets/css/style.scss @@ -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; + } } \ No newline at end of file diff --git a/themes/v2/layouts/archive/list.html b/themes/v2/layouts/archive/list.html @@ -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 }}