{{- 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 }}
{{ partial "printsinglebody.html" $p }}
{{ $tit := $p.Title }} {{ if gt (len $p.Title) 54 }} {{ $tit = printf "%s…" (substr $p.Title 0 50) }} {{ end }}
{{ substr $p.File.Dir 0 -1 }}⁄{{ $tit }}
{{ $p.Content }}
{{ range $scratch.has_children }}
{{ if not (.Scratch.Get "alreadyRendered") }} {{ $addS := 0 }} {{ with .Params.editors }} {{ $addS = len . }} {{ end }} {{ range $n, $authorFile := .Params.editors }} {{ $author := $.GetPage (printf "/editor/%s" $authorFile) }} {{ if eq $n 0 }}
editor{{ with (gt $addS 1) }}s{{ end }}⁄{{ $author.Title }} {{ else }} , {{ $author.Title }} {{ end }} {{ end }} {{ with .Params.editors }}
{{ end }} {{ $tit := .Title }} {{ if gt (len .Title) 54 }} {{ $tit = printf "%s…" (substr .Title 0 50) }} {{ end }}
{{ substr .File.Dir 0 -1 }}⁄{{ $tit }}
{{ partial "printsinglebody.html" . }} {{ .Content }} {{ .Scratch.Set "alreadyRendered" true }} {{end}} {{ $kid := $s.Get (printf "/%s" .File) }} {{ range $kid.has_children }} {{ if not (.Scratch.Get "alreadyRendered") }}
{{ $addS := 0 }} {{ with .Params.editors }} {{ $addS = len . }} {{ end }} {{ range $n, $authorFile := .Params.editors }} {{ $author := $.GetPage (printf "/editor/%s" $authorFile) }} {{ if eq $n 0 }}
editor{{ with (gt $addS 1) }}s{{ end }}⁄{{ $author.Title }} {{ else }} , {{ $author.Title }} {{ end }} {{ end }} {{ with .Params.editors }}
{{ end }} {{ $tit := .Title }} {{ if gt (len .Title) 54 }} {{ $tit = printf "%s…" (substr .Title 0 50) }} {{ end }}
{{ substr .File.Dir 0 -1 }}⁄{{ $tit }}
{{ partial "printsinglebody.html" . }} {{ .Content }} {{ $k := $s.Get (printf "/%s" .File) }} {{ if gt (len $k.is_in) 0 }} {{ end }} {{ .Scratch.Set "alreadyRendered" true }} {{ end }} {{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 }} {{ end }} {{ end }} {{ end }} {{- end -}}