{{- define "singlebody" -}} {{ $cssTemplate := `.css-_rplc_-h2 { counter-reset: css-_rplc_-h3; } .css-_rplc_-h3 { counter-reset: css-_rplc_-h4; } .css-_rplc_-h4 { counter-reset: css-_rplc_-h5; } .css-_rplc_-h5 { counter-reset: css-_rplc_-h6; } .css-_rplc_-h2:before { color: rgba(0, 0, 0, 0.4); counter-increment: css-_rplc_-h2 1; content: counter(css-_rplc_-h2) ". "; } .css-_rplc_-h3:before { color: rgba(0, 0, 0, 0.4); counter-increment: css-_rplc_-h3 1; content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) ". "; } .css-_rplc_-h4:before { color: rgba(0, 0, 0, 0.4); counter-increment: css-_rplc_-h4 1; content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) "." counter(css-_rplc_-h4) ". "; } .css-_rplc_-h5:before { color: rgba(0, 0, 0, 0.4); counter-increment: css-_rplc_-h5 1; content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) "." counter(css-_rplc_-h4) "." counter(css-_rplc_-h5) ". "; } .css-_rplc_-h6:before { color: rgba(0, 0, 0, 0.4); counter-increment: css-_rplc_-h6 1; content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) "." counter(css-_rplc_-h4) "." counter(css-_rplc_-h5) "." counter(css-_rplc_-h6) ". "; } .css-_rplc_-h2.nocount:before, .css-_rplc_-h3.nocount:before, .css-_rplc_-h4.nocount:before, .css-_rplc_-h5.nocount:before, .css-_rplc_-h6.nocount:before { content: ""; counter-increment: none; }` }} {{ $cssOutput := "" }} {{ $cssHashes := "" }} {{ $s := partialCached "scratch.html" . }} {{ $p := $.GetPage .Params.print }} {{ $scratch := $s.Get (printf "/%s" $p.File) }} {{ $currentDir := "" }} {{ with .File }} {{ $currentDir = .Dir }} {{ end }}
{{ partial "printsinglebody.html" $p }}
{{ $p.Content }}
{{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" $p.File.UniqueID) }} {{ $cssHashes = printf "%s css-%s-h2" $cssHashes $p.File.UniqueID }} {{ range $scratch.has_children }}
{{ $addS := 0 }} {{ with .Params.authors }} {{ $addS = len . }} {{ end }} {{ range $n, $authorFile := .Params.authors }} {{ $author := $.GetPage (printf "/author/%s" $authorFile) }} {{ if eq $n 0 }}
author{{ with (gt $addS 1) }}s{{ end }}⁄{{ $author.Title }} {{ else }} , {{ $author.Title }} {{ end }} {{ end }} {{ with .Params.authors }}
{{ end }} {{ $tit := .Title }} {{ if gt (len .Title) 54 }} {{ $tit = printf "%s…" (substr .Title 0 50) }} {{ end }}
{{ index $scratch.crust 0 }}⁄{{ $tit }}
{{ partial "printsinglebody.html" . }} {{ .Content }} {{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" .File.UniqueID) }} {{ $cssHashes = printf "%s css-%s-h2" $cssHashes .File.UniqueID }} {{ $kid := $s.Get (printf "/%s" .File) }} {{ range $kid.has_children }}
{{ $addS := 0 }} {{ with .Params.authors }} {{ $addS = len . }} {{ end }} {{ range $n, $authorFile := .Params.authors }} {{ $author := $.GetPage (printf "/author/%s" $authorFile) }} {{ if eq $n 0 }}
author{{ with (gt $addS 1) }}s{{ end }}⁄{{ $author.Title }} {{ else }} , {{ $author.Title }} {{ end }} {{ end }} {{ with .Params.authors }}
{{ end }} {{ $tit := .Title }} {{ if gt (len .Title) 54 }} {{ $tit = printf "%s…" (substr .Title 0 50) }} {{ end }}
{{ index $scratch.crust 0 }}⁄{{ $tit }}
{{ partial "printsinglebody.html" . }} {{ .Content }} {{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" .File.UniqueID) }} {{ $cssHashes = printf "%s css-%s-h2" $cssHashes .File.UniqueID }} {{ end }} {{ end }} {{ range where $.Site.RegularPages "Section" "in" (slice "author" "editor") }}
{{ index $scratch.mantle 0 }}⁄{{ $p.Title }}
{{ substr .File.Dir 0 -1 }}⁄{{ .Title }}
{{ .Content }} {{ if in .Page.Site.Params.sandpointsMentionedIn (substr .File.Dir 0 -1) }} {{ $ss := $s.Get (printf "/%s" .File) }}
{{ with $ss }}
mentioned in⁄
{{ end }}
{{ range $ss.backlinks }} {{ end }}
{{ end }} {{ end }} {{ $cssOutput = printf "body {counter-reset: %s;}\n%s" $cssHashes $cssOutput }} {{ $var := $cssOutput | resources.FromString "css/dyn.css" }} {{ $dummy := $var.Permalink }} {{- end -}}