SandpointsTheme/layouts/partials/singlebody.html

79 lines
3 KiB
HTML
Raw Normal View History

2020-11-29 01:28:30 +01:00
{{ $s := partialCached "scratch.html" . }}
{{ $currentNode := . }}
{{ $currentDir := "" }}
{{ with .File }}
{{ $currentDir = .Dir }}
{{ end }}
{{ $currentFile := (printf "/%s" .File) }}
{{ $scratch := $s.Get $currentFile }}
2020-12-10 01:58:18 +01:00
<div class="{{ $scratch.depth | default "crust" }}title"><span class="supt">{{ substr $currentDir 0 -1 }}{{ substr .Title 0 1 }}</span>{{ substr .Title 1 }}</div></div>
2020-11-29 01:28:30 +01:00
<div class="grid">
<div class="leftcolumn">
{{ if ne (trim .Page.TableOfContents "\n") "<nav id=\"TableOfContents\"></nav>" }}
{{ .Page.TableOfContents }}
{{ end }}
</div>
<div class="rightcolumn">
2020-12-10 01:58:18 +01:00
{{- range $k, $v := .Page.Params.authors -}}
{{- with $.GetPage (printf "/author/%s" $v) -}}
{{- with not $k -}}
<div class="has hasauthors">
<div class="hassup">authors</div>
<div class="afterhas">
{{- end -}}
<div class="crust">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{- end -}}
{{- end -}}
{{- with .Page.Params.authors -}}</div></div>{{- end -}}
2020-12-09 03:27:46 +01:00
{{ if in .Page.Site.Params.sandpointsMentionedIn (substr $currentDir 0 -1) }}
<div class="has">
{{ with $scratch.backlinks }}
2020-12-10 01:58:18 +01:00
<div class="hassup">mentioned in</div>
2020-11-29 01:28:30 +01:00
{{ end }}
<div class="afterhas">
{{ range $scratch.backlinks }}
<div class="{{ $scratch.child_depth }}">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
2020-11-29 01:28:30 +01:00
{{ end }}
2020-12-10 01:58:18 +01:00
</div></div>
{{ end }}
2020-11-29 01:28:30 +01:00
{{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }}
<div class="has">
{{ with $scratch.has }}
2020-12-10 01:58:18 +01:00
<div class="hassup">has {{ $scratch.has }}</div>
2020-11-29 01:28:30 +01:00
{{ end }}
<div class="afterhas">
{{ range $scratch.has_children }}
<div class="{{ $scratch.child_depth }}">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{ end }}
2020-12-10 01:58:18 +01:00
</div></div>
{{ end }}
{{ if eq $scratch.depth "crust" }}
<div class="has">
2020-12-10 01:58:18 +01:00
<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 }}
2020-12-10 01:58:18 +01:00
</div></div>
{{ end }}
</div>
2020-11-29 01:28:30 +01:00
</div>
{{ with .Page.Params.abstract }}<div class="abstract"><span class="supt">abstract</span>{{ . | markdownify }}</div>{{ end }}
{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}<div
2020-12-10 02:39:30 +01:00
class="keywords"><span class="sup">keywords</span>{{- $v -}}{{- else -}},&nbsp;{{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}