2021-08-31 22:26:23 +02:00
{{- define "singlebody" -}}
{{ $cssOutput := "" }}
{{ $cssHashes := "" }}
{{ $s := partialCached "scratch.html" . }}
{{ $p := $.GetPage .Params.print }}
{{ $scratch := $s.Get (printf "/%s" $p.File) }}
{{ $currentDir := "" }}
{{ with .File }}
{{ $currentDir = .Dir }}
{{ end }}
< div class = "print0" > {{ partial "printsinglebody.html" $p }}< / div >
2021-09-09 17:08:19 +02:00
{{ $tit := $p.Title }}
{{ if gt (len $p.Title) 54 }}
{{ $tit = printf "%s…" (substr $p.Title 0 50) }}
{{ end }}
< div class = "runningTitle" > < span class = "sup" > {{ substr $p.File.Dir 0 -1 }}⁄ < / span > < a href = "#ph-{{ $p.File.UniqueID }}" > {{ $tit }}< / a > < / div >
2021-08-31 22:26:23 +02:00
< div class = "content" > {{ $p.Content }}< / div >
{{ range $scratch.has_children }}
< div class = "crustpage" >
2021-09-09 12:16:58 +02:00
{{ if not (.Scratch.Get "alreadyRendered") }}
{{ $addS := 0 }}
{{ with .Params.editors }}
{{ $addS = len . }}
2021-08-31 22:26:23 +02:00
{{ end }}
2021-09-09 12:16:58 +02:00
{{ range $n, $authorFile := .Params.editors }}
{{ $author := $.GetPage (printf "/editor/%s" $authorFile) }}
{{ if eq $n 0 }}
< div class = "runningAuthors" > < span class = "sup" > editor{{ with (gt $addS 1) }}s{{ end }}⁄ < / span > < a href = "#ph-{{ $author.File.UniqueID }}" > {{ $author.Title }}< / a >
{{ else }}
, < a href = "#ph-{{ $author.File.UniqueID }}" > {{ $author.Title }}< / a >
{{ end }}
{{ end }}
{{ with .Params.editors }}< / div > {{ end }}
{{ $tit := .Title }}
{{ if gt (len .Title) 54 }}
{{ $tit = printf "%s…" (substr .Title 0 50) }}
{{ end }}
2021-09-09 17:08:19 +02:00
< div class = "runningTitle" > < span class = "sup" > {{ substr .File.Dir 0 -1 }}⁄ < / span > < a href = "#ph-{{ .File.UniqueID }}" > {{ $tit }}< / a > < / div >
2021-09-09 12:16:58 +02:00
{{ partial "printsinglebody.html" . }}
{{ .Content }}
{{ .Scratch.Set "alreadyRendered" true }}
{{end}}
2021-08-31 22:26:23 +02:00
{{ $kid := $s.Get (printf "/%s" .File) }}
{{ range $kid.has_children }}
2021-09-09 12:16:58 +02:00
{{ if not (.Scratch.Get "alreadyRendered") }}
< div class = "crustpage" >
{{ $addS := 0 }}
{{ with .Params.editors }}
{{ $addS = len . }}
2021-08-31 22:26:23 +02:00
{{ end }}
2021-09-09 12:16:58 +02:00
{{ range $n, $authorFile := .Params.editors }}
{{ $author := $.GetPage (printf "/editor/%s" $authorFile) }}
{{ if eq $n 0 }}
< div class = "runningAuthors" > < span class = "sup" > editor{{ with (gt $addS 1) }}s{{ end }}⁄ < / span > < a href = "#ph-{{ $author.File.UniqueID }}" > {{ $author.Title }}< / a >
{{ else }}
, < a href = "#ph-{{ $author.File.UniqueID }}" > {{ $author.Title }}< / a >
{{ end }}
{{ end }}
{{ with .Params.editors }}< / div > {{ end }}
{{ $tit := .Title }}
{{ if gt (len .Title) 54 }}
{{ $tit = printf "%s…" (substr .Title 0 50) }}
{{ end }}
2021-09-09 17:08:19 +02:00
< div class = "runningTitle" > < span class = "sup" > {{ substr .File.Dir 0 -1 }}⁄ < / span > < a href = "#ph-{{ .File.UniqueID }}" > {{ $tit }}< / a > < / div >
2021-09-09 12:16:58 +02:00
{{ partial "printsinglebody.html" . }}
{{ .Content }}
{{ $k := $s.Get (printf "/%s" .File) }}
{{ if gt (len $k.is_in) 0 }}
< div class = "backlinks" > < span class = "supt" > is in⁄ < / span > {{- range $i, $v := $k.is_in -}}{{ if ne $i 0 }}, {{ end }}< a href = "#ph-{{ .File.UniqueID }}" > {{ .Title }}< / a > {{- end -}}< / div >
{{ end }}
{{ .Scratch.Set "alreadyRendered" true }}
{{ end }}
{{end}}
2021-08-31 22:26:23 +02:00
{{ end }}
{{ range where $.Site.RegularPages "Section" "in" (slice "author" "editor") }}
< div class = "authorpage" >
< div class = "runningTitle runningAuthors" > < span class = "sup" > {{ index $scratch.mantle 0 }}⁄ < / span > < a href = "#ph-{{ $p.File.UniqueID }}" > {{ $p.Title }}< / a > < / div >
< div id = "ph-{{ .File.UniqueID }}" class = "{{ $scratch.depth | default " crust " } } title " > < span class = "supt" > {{ substr .File.Dir 0 -1 }}⁄ < / span > {{ .Title }}< / div >
{{ .Content }}
{{ if in .Page.Site.Params.sandpointsMentionedIn (substr .File.Dir 0 -1) }}
{{ $ss := $s.Get (printf "/%s" .File) }}
2021-09-09 12:16:58 +02:00
{{ with $ss }}
< div class = "backlinks" > < span class = "supt" > mentioned in⁄ < / span > {{- range $i, $v := $ss.backlinks -}}{{ if ne $i 0 }}, {{ end }}< a href = "#ph-{{ .File.UniqueID }}" > {{ .Title }}< / a > {{- end -}}< / div >
{{ end }}
2021-08-31 22:26:23 +02:00
{{ end }}
{{ end }}
{{- end -}}