only mentioned editors + authors to print

master
Marcell Mars 1 year ago
parent f652b684e8
commit 5f3c00c14d

@ -62,6 +62,22 @@
{{ $p := $.GetPage .Params.print }}
{{ $scratch := $s.Get (printf "/%s" $p.File) }}
{{ $authorsPages := (slice) }}
{{ with $p.Params.authors }}
{{ range $n, $authorFile := . }}
{{ $author := $.GetPage (printf "/author/%s" $authorFile) }}
{{ $authorsPages = (uniq $authorsPages) | append $author }}
{{ end }}
{{ end }}
{{ $editorsPages := (slice) }}
{{ with $p.Params.editors }}
{{ range $n, $editorFile := . }}
{{ $editor := $.GetPage (printf "/editor/%s" $editorFile) }}
{{ $editorsPages = (uniq $editorsPages) | append $editor }}
{{ end }}
{{ end }}
{{ $currentDir := "" }}
{{ with .File }}
{{ $currentDir = .Dir }}
@ -78,8 +94,17 @@
{{ with .Params.authors }}
{{ $addS = len . }}
{{ end }}
{{ with .Params.editors }}
{{ range $n, $editorFile := . }}
{{ $editor := $.GetPage (printf "/editor/%s" $editorFile) }}
{{ $editorsPages = (uniq $editorsPages) | append $editor }}
{{ end }}
{{ end }}
{{ range $n, $authorFile := .Params.authors }}
{{ $author := $.GetPage (printf "/author/%s" $authorFile) }}
{{ $authorsPages = (uniq $authorsPages) | append $author }}
{{ if eq $n 0 }}
<div class="runningAuthors"><span class="sup">author{{ with (gt $addS 1) }}s{{ end }}</span><a href="#ph-{{ $author.File.UniqueID }}">{{ $author.Title }}</a>
{{ else }}
@ -125,8 +150,8 @@
{{ $cssHashes = printf "%s css-%s-h2" $cssHashes .File.UniqueID }}
{{ end }}
{{ end }}
{{ range where $.Site.RegularPages "Section" "in" (slice "author" "editor") }}
{{ range union (uniq $editorsPages) (uniq $authorsPages) }}
<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>

Loading…
Cancel
Save