97 lines
3.9 KiB
HTML
97 lines
3.9 KiB
HTML
{{ $s := partialCached "scratch.html" . }}
|
||
|
||
{{ $currentNode := . }}
|
||
{{ $currentDir := "" }}
|
||
{{ with .File }}
|
||
{{ $currentDir = .Dir }}
|
||
{{ end }}
|
||
{{ $currentFile := (printf "/%s" .File) }}
|
||
{{ $scratch := $s.Get $currentFile }}
|
||
|
||
{{ $longestTitle := "" }}
|
||
|
||
<div id="ph-{{ .File.UniqueID }}" class="{{ $scratch.depth | default "crust" }}title"><span class="supt">{{ substr $currentDir 0 -1 }}⁄</span>{{ .Title }}</div>
|
||
|
||
<div class="grid">
|
||
<div class="leftcolumn">
|
||
{{ if ne (trim .Page.TableOfContents "\n") "<nav id=\"TableOfContents\"></nav>" }}
|
||
{{ .Page.TableOfContents }}
|
||
{{ end }}
|
||
</div>
|
||
<div class="rightcolumn">
|
||
{{ $closeDivs := false }}
|
||
{{ $sandnamePlural := (slice) }}
|
||
{{ range $k, $v := $.Site.Data.sandpointsnamegraph }}
|
||
{{ $sandnamePlural = $sandnamePlural | append $v }}
|
||
{{ end }}
|
||
{{ $paramsKeys := (slice) }}
|
||
{{ range $k, $v := $currentNode.Params }}
|
||
{{ $paramsKeys = $paramsKeys | append $k }}
|
||
{{ end }}
|
||
{{ $mentions := intersect $paramsKeys $sandnamePlural }}
|
||
{{ range $mention := $mentions }}
|
||
{{ range $k, $m := index $currentNode.Params $mention }}
|
||
{{ $mentionLink := printf "/%s/%s" (substr $mention 0 -1) $m }}
|
||
{{- with $.GetPage $mentionLink -}}
|
||
{{ with not $k }}
|
||
{{ $closeDivs = true }}
|
||
<div class="has hasauthors">
|
||
<div class="hassup">{{ with (index $currentNode.Params $mention) }}{{ if gt (len (index $currentNode.Params $mention)) 1 }}{{ $mention }}{{ else }}{{ substr $mention 0 -1 }}{{ end }}{{ end }}⁄</div>
|
||
<div class="afterhas">
|
||
{{ end }}
|
||
<div class="crust">
|
||
<a href="#ph-{{ .File.UniqueID }}">{{ .Title }}</a>
|
||
</div>
|
||
{{ end }}
|
||
{{ end }}
|
||
{{ end }}
|
||
{{- with $closeDivs -}}</div></div>{{ end }}
|
||
|
||
{{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }}
|
||
<div class="has hashas">
|
||
{{ with $scratch.has }}
|
||
<div class="hassup">has {{ $scratch.has }}⁄</div>
|
||
{{ end }}
|
||
<div class="afterhas">
|
||
{{ range $scratch.has_children }}
|
||
{{ $authors := "" }}
|
||
{{ range $k, $authorLink := .Params.authors }}
|
||
{{ $authorPage := $.GetPage (printf "/author/%s" $authorLink) }}
|
||
{{ $prefix := ", " }}
|
||
{{ with not $k }}
|
||
{{ $prefix = "" }}
|
||
{{ end }}
|
||
{{ $authors = printf "%s%s" $prefix $authorPage.Title }}
|
||
{{ end }}
|
||
<div class="{{ $scratch.child_depth }} crustoc">
|
||
<a class="toc" href="#ph-{{ .File.UniqueID }}"><span><span class="back">{{ .Title }} {{with $authors}}({{ $authors }}){{ end }}</span></span></a>
|
||
</div>
|
||
{{ if gt (len .Title) (len $longestTitle) }}
|
||
{{ $longestTitle = .Title }}
|
||
{{ end }}
|
||
{{ end }}
|
||
<div class="{{ $scratch.child_depth }} crustoc longesttitle">
|
||
<a class="toc" href="javascript:;"><span><span class="back">{{ $longestTitle }}.....</span></span></a>
|
||
</div>
|
||
</div></div>
|
||
{{ end }}
|
||
|
||
{{ if eq $scratch.depth "crust" }}
|
||
<div class="has hasin">
|
||
<div class="hassup">in {{ index $scratch.in 1 }}⁄</div>
|
||
<div class="afterhas">
|
||
{{ range $scratch.is_in }}
|
||
<div class="{{ substr $currentDir 0 -1 }}">
|
||
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
|
||
</div>
|
||
{{ end }}
|
||
</div></div>
|
||
{{ end }}
|
||
</div>
|
||
</div>
|
||
|
||
|
||
{{ with .Page.Params.abstract }}<div class="abstract"><span class="supt">abstract⁄</span>{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}</div>{{ end }}
|
||
|
||
{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}<div class="keywords"><span class="sup">keywords⁄</span>{{- $v -}}{{- else -}}, {{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}
|