- {{ $addS := 0 }}
- {{ with .Params.editors }}
- {{ $addS = len . }}
- {{ end }}
- {{ range $n, $authorFile := .Params.editors }}
- {{ $author := $.GetPage (printf "/editor/%s" $authorFile) }}
- {{ if eq $n 0 }}
-
{{ end }}
+ {{ range $n, $authorFile := .Params.editors }}
+ {{ $author := $.GetPage (printf "/editor/%s" $authorFile) }}
+ {{ if eq $n 0 }}
+
{{ end }}
- {{ $tit := .Title }}
- {{ if gt (len .Title) 54 }}
- {{ $tit = printf "%s…" (substr .Title 0 50) }}
- {{ end }}
-
- {{ partial "printsinglebody.html" . }}
- {{ .Content }}
- {{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" .File.UniqueID) }}
- {{ $cssHashes = printf "%s css-%s-h2" $cssHashes .File.UniqueID }}
+ {{ $tit := .Title }}
+ {{ if gt (len .Title) 54 }}
+ {{ $tit = printf "%s…" (substr .Title 0 50) }}
+ {{ end }}
+
+ {{ partial "printsinglebody.html" . }}
+ {{ .Content }}
+ {{ .Scratch.Set "alreadyRendered" true }}
+ {{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" .File.UniqueID) }}
+ {{ $cssHashes = printf "%s css-%s-h2" $cssHashes .File.UniqueID }}
+
+ {{end}}
{{ $kid := $s.Get (printf "/%s" .File) }}
{{ range $kid.has_children }}
-
- {{ $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 }}
+ {{ if not (.Scratch.Get "alreadyRendered") }}
+
+ {{ $addS := 0 }}
+ {{ with .Params.editors }}
+ {{ $addS = len . }}
{{ end }}
- {{ end }}
- {{ with .Params.editors }}
{{ end }}
+ {{ range $n, $authorFile := .Params.editors }}
+ {{ $author := $.GetPage (printf "/editor/%s" $authorFile) }}
+ {{ if eq $n 0 }}
+
{{ end }}
- {{ $tit := .Title }}
- {{ if gt (len .Title) 54 }}
- {{ $tit = printf "%s…" (substr .Title 0 50) }}
- {{ end }}
-
- {{ 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 }}
+ {{ $tit := .Title }}
+ {{ if gt (len .Title) 54 }}
+ {{ $tit = printf "%s…" (substr .Title 0 50) }}
+ {{ end }}
+
+ {{ partial "printsinglebody.html" . }}
+ {{ .Content }}
+ {{ $k := $s.Get (printf "/%s" .File) }}
+ {{ if gt (len $k.is_in) 0 }}
+
is in⁄{{- range $i, $v := $k.is_in -}}{{ if ne $i 0 }}, {{ end }}
{{ .Title }}{{- end -}}
+ {{ end }}
+
+ {{ .Scratch.Set "alreadyRendered" true }}
+ {{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" .File.UniqueID) }}
+ {{ $cssHashes = printf "%s css-%s-h2" $cssHashes .File.UniqueID }}
+ {{ end }}
+ {{end}}
{{ end }}
{{ range where $.Site.RegularPages "Section" "in" (slice "author" "editor") }}
@@ -134,19 +146,12 @@
{{ 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 }}
-
+ {{ with $ss }}
+
mentioned in⁄{{- range $i, $v := $ss.backlinks -}}{{ if ne $i 0 }}, {{ end }}
{{ .Title }}{{- end -}}
+ {{ end }}
{{ end }}
{{ end }}
+
{{ $cssOutput = printf "body {counter-reset: %s;}\n%s" $cssHashes $cssOutput }}
{{ $var := $cssOutput | resources.FromString "css/dyn.css" }}
{{ $dummy := $var.Permalink }}
diff --git a/layouts/partials/printsinglebody.html b/layouts/partials/printsinglebody.html
index 977f14b..676d824 100644
--- a/layouts/partials/printsinglebody.html
+++ b/layouts/partials/printsinglebody.html
@@ -8,6 +8,8 @@
{{ $currentFile := (printf "/%s" .File) }}
{{ $scratch := $s.Get $currentFile }}
+{{ $longestTitle := "" }}
+
{{ substr $currentDir 0 -1 }}⁄{{ .Title }}
@@ -64,7 +66,13 @@
+ {{ if gt (len .Title) (len $longestTitle) }}
+ {{ $longestTitle = .Title }}
+ {{ end }}
{{ end }}
+
{{ end }}
diff --git a/static/css/print.css b/static/css/print.css
index 8dcf660..4682b5e 100644
--- a/static/css/print.css
+++ b/static/css/print.css
@@ -200,7 +200,8 @@
bottom: 0
}
- .crustoc::after {
+ a.toc::before {
+ direction: rtl;
content: " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ";
line-height: 0;
height: 1px;
@@ -233,4 +234,9 @@
ol[data-split-from] {
padding-left: 0.5rem;
}
+
+ .longesttitle {
+ visibility: hidden;
+ cursor: default;
+ }
}