bunch of unifying formatting

This commit is contained in:
Marcell Mars 2020-12-15 02:09:00 +01:00
parent c507484d55
commit 1c8bf451ef
15 changed files with 464 additions and 528 deletions

View file

@ -1,96 +0,0 @@
{{ $s := partialCached "scratch.html" . }}
{{ $currentFile := (printf "/%s" .File) }}
{{ $scratch := $s.Get $currentFile }}
{{ $is_in_ := newScratch }}
{{ with eq $scratch.depth "crust" }}
{{ range $scratch.is_in }}
{{ range $k,$v := $s.Get (printf "/%s" .File) }}
{{ if eq $k "is_in" }}
{{ range $v }}
{{ $is_in_.Set (printf "/%s" .File) (printf "/%s" .File) }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ $is_in_is_in := (slice) }}
{{ range $is_in_.Values }}
{{ $is_in_is_in = $is_in_is_in | append ($.GetPage .) }}
{{ end }}
{{ if eq hugo.Environment "preview" }}
{{- $giteaUrl := .Site.Params.sandpointsGiteaUrl -}}
<div class="headiter">
<a class="edit-button" target="_blank" href="{{ $giteaUrl }}/_edit/master/content/{{ .File }}">EDIT_THIS</a>
<a class="edit-button" target="_blank" href="{{ $giteaUrl }}/_new/master/content/{{ with $scratch.core }}{{ index . 0 }}{{ end }}/">ADD_{{ with $scratch.core }}{{ index . 0 | upper }}{{ end }}</a>
<a class="edit-button" target="_blank" href="{{ $giteaUrl }}/_new/master/content/{{ with $scratch.mantle }}{{ index . 0 }}{{ end }}/">ADD_{{ with $scratch.mantle }}{{ index . 0 | upper }}{{ end }}</a>
<a class="edit-button" target="_blank" href="{{ $giteaUrl }}/_new/master/content/{{ with $scratch.crust }}{{ index . 0 }}{{ end }}/">ADD_{{ with $scratch.crust }}{{ index . 0 | upper }}{{ end }}</a>
<a class="edit-button" target="_blank" href="{{ $giteaUrl }}/_edit/master/PUBLISH.trigger.md">PUBLISH</a>
<a class="edit-button" target="_blank" href="{{ $giteaUrl }}"> ? </a>
</div>
{{ end }}
<p>*****************************************************</p>
<div class="header">
<a title="{{ $.Site.Home.Title }}'s Bibliotheke" href="/library/BROWSE_LIBRARY.html" class="bibliotheke" target="_blank">
<img src="/images/bibliotheke.svg" />
</a>
<div class="breadcrumbs">
{{ if eq $scratch.depth "mantle" }}
{{ with gt (len $scratch.is_in) 1 }}
<div class="ddmenu">
<input id="toggly0" type="checkbox">
<label for="toggly0" tabindex="1"><span class="sup">cf.&nbsp;</span><a href="{{ with (index $scratch.is_in 0) }}{{ .RelPermalink }}{{ end }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ with index $scratch.is_in 0 }}<i>{{ .Title }}</i></a>&nbsp;{{ end }}</label>
<div class="hiddendiv">
<ul class="mt-4">
{{ range after 1 $scratch.is_in }}
<li><a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}"><i>{{ .Title }}</i></a></li>
{{ end }}
</ul>
</div>
</div>
{{ else }}
<a href="{{ with (index $scratch.is_in 0) }}{{ .RelPermalink }}{{ end }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}"><span class="sup">{{ with (index $scratch.is_in 0) }}{{ substr .Title 0 1 }}</span><i>{{ substr .Title 1 }}</i></a>{{ end }}
{{ end }}
<span class="mantlebar"><i> » <a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a></i></span>
{{ end }}
{{ if eq $scratch.depth "crust" }}
{{ with gt (len $is_in_is_in) 1 }}
<div class="ddmenu">
<input id="toggly1" type="checkbox">
<label for="toggly1" tabindex="1"><span class="sup">cf.&nbsp;</span><a href="{{ with (index $is_in_is_in 0) }}{{ .RelPermalink }}{{ end }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ with (index $is_in_is_in 0) }}<i>{{ .Title }}</i></a>&nbsp;{{ end }}</label>
<div class="hiddendiv">
<ul class="mt-4">
{{ range after 1 $is_in_is_in }}
<li><a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}"><i>{{ .Title }}</i></a></li>
{{ end }}
</ul>
</div>
</div>
{{ else }}
{{ $home := index $is_in_is_in 0 }}
<a href="{{ $home.RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}"><span class="sup">{{ substr $home.Title 0 1 }}</span><i>{{ substr $home.Title 1 }}</i></a>
{{ end }}
{{ with gt (len $scratch.is_in) 1 }}
»&nbsp;
<div class="ddmenu">
<input id="toggly" type="checkbox">
<label for="toggly" tabindex="1"><span class="sup">cf.&nbsp;</span><a href="{{ with (index $scratch.is_in 0) }}{{ .RelPermalink }}{{ end }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ with (index $scratch.is_in 0) }}<i>{{ .Title }}</i></a>&nbsp;{{ end }}</label>
<div class="hiddendiv">
<ul class="mt-4">
{{ range after 1 $scratch.is_in }}
<li><a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}"><i>{{ .Title }}</i></a></li>
{{ end }}
</ul>
</div>
</div>
{{ else }}»&nbsp;<a href="{{ with (index $scratch.is_in 0) }}{{ .RelPermalink }}{{ end }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ with (index $scratch.is_in 0) }}<i>{{ .Title }}</i></a>{{ end }}
{{ end }}
<span class="mantlebar"><i> » <a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a></i></span>
{{ end }}
</div>
</div>

View file

@ -1,6 +1,5 @@
{{ define "singlebody" }}
{{ $currentNode := . }}
{{ $currentDir := "" }}
{{ with .File }}

View file

@ -1,11 +1,6 @@
{{- define "singlebody" -}}
{{- partialCached "header.html" . .RelPermalink -}}
<h1>{{ .Title }}</h1>
{{- partialCached "singlebody.html" . .RelPermalink -}}
<div class="content">{{ .Content }}</div>
{{- partialCached "header.html" . .RelPermalink -}}
<h1>{{ .Title }}</h1>
{{- partialCached "singlebody.html" . .RelPermalink -}}
<div class="content">{{ .Content }}</div>
{{- end -}}

View file

@ -1 +0,0 @@
{{ .Scratch }}

View file

@ -4,13 +4,15 @@
<meta name="theme-color" content="#ffffff">
{{ if .Description }}
<meta name="description" content="{{ .Description }}" />
<meta name="description" content="{{ .Description }}" />
{{ end }}
{{ if .Keywords }}
<meta name="keywords" content="{{ delimit .Keywords "," }}" />
<meta name="keywords" content="{{ delimit .Keywords "," }}" />
{{ end }}
{{ if .Params.Author }}
<meta name="author" content="{{ .Params.Author}}" />
<meta name="author" content="{{ .Params.Author}}" />
{{ end }}
{{ template "_internal/opengraph.html" . }}

View file

@ -180,7 +180,7 @@
{{ end }}
{{ end }}
{{ $_.SetInMap $pPath "debug" (printf "%#v" $debug) }}
{{ $_.SetInMap $pPath "debug" (printf "%#v" $debug) }}
{{ end }}
{{ return $_ }}

13
layouts/print/baseof.html Normal file
View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{- else -}}en-us{{- end -}}">
<head>
{{- partialCached "head.html" . -}}
{{- partial "pagedjs.html" . -}}
</head>
<body>
<article>
{{- block "singlebody" . -}}{{- end -}}
</article>
</body>
</html>

24
layouts/print/single.html Normal file
View file

@ -0,0 +1,24 @@
{{- define "singlebody" -}}
{{ $s := partialCached "scratch.html" . }}
{{ $p := $.GetPage .Params.print }}
{{ $scratch := $s.Get (printf "/%s" $p.File) }}
{{ $currentDir := "" }}
{{ with .File }}
{{ $currentDir = .Dir }}
{{ end }}
<div class="print0">{{ partial "singlebody.html" $p }}</div>
<div class="content">{{ $p.Content }}
{{ range $printPage := $scratch.has_cildren }}
<div class="print1">{{ partial "singlebody.html" $printPage }}</div>
<div class="content">{{ $printPage.Content }}
{{ $printPageScratch := $s.Get (printf "/%s" $printPage.File) }}
{{ range $printPageKid := $printPageScratch.has_children }}
<div class="print2">{{ partial "singlebody.html" $printPageKid }}</div>
<div class="content">{{ $printPageKid.Content }}
{{ . }}
{{ end }}
</div>
{{ end }}
{{- end -}}