From 1331ed0e53524538273961bd55689cf400ca227b Mon Sep 17 00:00:00 2001 From: Marcell Mars Date: Sun, 30 Mar 2025 11:49:25 +0200 Subject: [PATCH] clean it up first --- layouts/404.html | 3 - layouts/_default/_markup/render-heading.html | 30 --- layouts/_default/_markup/render-image.html | 60 ------ layouts/_default/_markup/render-link.html | 2 +- layouts/_default/baseof.html | 22 +- layouts/_default/list.html | 57 ++---- layouts/_default/single.html | 13 +- layouts/edit/baseof.html | 14 -- layouts/edit/list.html | 2 - layouts/edit/single.html | 1 - layouts/metadata/baseof.js.js | 1 - layouts/metadata/list.js.js | 20 -- layouts/partials/footer.html | 15 +- layouts/partials/head.html | 48 ----- layouts/partials/header.html | 114 ----------- layouts/partials/pagedjs.html | 3 - layouts/partials/printsinglebody.html | 96 --------- layouts/partials/readdir.html | 13 -- layouts/partials/sandpointjs.html | 4 - layouts/partials/scratch.html | 202 ------------------- layouts/partials/singlebody.html | 105 ---------- layouts/print/baseof.html | 11 - layouts/print/single.html | 113 ----------- layouts/shortcodes/gloss.html | 25 --- layouts/shortcodes/nosup.html | 1 - layouts/shortcodes/soundcloud.html | 10 - layouts/taxonomy/baseof.html | 12 -- layouts/taxonomy/list.html | 23 --- layouts/urls/baseof.html | 12 -- layouts/urls/list.html | 104 ---------- 30 files changed, 50 insertions(+), 1086 deletions(-) delete mode 100644 layouts/404.html delete mode 100644 layouts/_default/_markup/render-heading.html delete mode 100644 layouts/_default/_markup/render-image.html delete mode 100644 layouts/edit/baseof.html delete mode 100644 layouts/edit/list.html delete mode 100644 layouts/edit/single.html delete mode 100644 layouts/metadata/baseof.js.js delete mode 100644 layouts/metadata/list.js.js delete mode 100644 layouts/partials/head.html delete mode 100644 layouts/partials/header.html delete mode 100644 layouts/partials/pagedjs.html delete mode 100644 layouts/partials/printsinglebody.html delete mode 100644 layouts/partials/readdir.html delete mode 100644 layouts/partials/sandpointjs.html delete mode 100644 layouts/partials/scratch.html delete mode 100644 layouts/partials/singlebody.html delete mode 100644 layouts/print/baseof.html delete mode 100644 layouts/print/single.html delete mode 100644 layouts/shortcodes/gloss.html delete mode 100644 layouts/shortcodes/nosup.html delete mode 100644 layouts/shortcodes/soundcloud.html delete mode 100644 layouts/taxonomy/baseof.html delete mode 100644 layouts/taxonomy/list.html delete mode 100644 layouts/urls/baseof.html delete mode 100644 layouts/urls/list.html diff --git a/layouts/404.html b/layouts/404.html deleted file mode 100644 index ac4ef34..0000000 --- a/layouts/404.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ define "main" }} -

404 - page not found

-{{ end }} diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html deleted file mode 100644 index e05ac21..0000000 --- a/layouts/_default/_markup/render-heading.html +++ /dev/null @@ -1,30 +0,0 @@ -{{ $currentLevel := .Level }} -{{ $currentHeaderKey := printf "H_%d" $currentLevel }} - -{{ if not (.Page.Scratch.Get $currentHeaderKey) }} - {{ .Page.Scratch.Set $currentHeaderKey 1 }} -{{ else }} - {{ .Page.Scratch.Set $currentHeaderKey (add 1 (.Page.Scratch.Get $currentHeaderKey)) }} -{{ end }} - -{{ if .Page.Scratch.Get "previousLevel" }} - {{ $previousLevel := .Page.Scratch.Get "previousLevel" }} - {{ if gt $previousLevel $currentLevel }} - {{ range $header := slice 1 2 3 4 5 6 }} - {{ if gt $header $currentLevel }} - {{ $.Page.Scratch.Delete (printf "H_%d" $header) }} - {{ end }} - {{ end }} - {{ end }} -{{ end }} - -{{ $counter := "" }} -{{ range $header := slice 1 2 3 4 5 6 }} -{{ if gt ($.Page.Scratch.Get (printf "H_%d" $header)) 0 }} - {{ $counter = printf "%s%d." $counter ($.Page.Scratch.Get (printf "H_%d" $header))}} -{{ end }} -{{end}} - -{{ $counter }} {{ .Text | safeHTML }} {{ .Page.Scratch.Get "level" }} - -{{ .Page.Scratch.Set "previousLevel" .Level }} diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html deleted file mode 100644 index 2955281..0000000 --- a/layouts/_default/_markup/render-image.html +++ /dev/null @@ -1,60 +0,0 @@ -{{- $text_link := .Text -}} - -{{ $_ := newScratch }} -{{- range $k, $v := .Page.Site.Data.sandpointsnamegraph -}} - {{ $_.Add "triads" $k }} -{{- end -}} - -{{- if strings.HasPrefix .Destination "img:" -}} - {{- $img_params := (substr .Destination 4) -}} - {{- $img_src := index (split $img_params " ") 0 -}} - {{- $img_attr := index (split $img_params $img_src) 1 -}} - -{{- else if strings.HasPrefix .Destination "vid:" -}} - {{- $vid_params := (substr .Destination 4) -}} - {{- $vid_src := index (split $vid_params " ") 0 -}} - {{- $vid_attr := index (split $vid_params $vid_src) 1 -}} - -{{- else if strings.HasPrefix .Destination "bib:" -}} - {{- $destination := (substr .Destination 4) -}} - {{- $c_prefix := .Page.Site.Params.sandpointsCatalogPrefix | default "/library/" -}} - {{- if index $.Page.Site.Data.books.catalog $destination -}} - {{- $b := index $.Page.Site.Data.books.catalog $destination -}} - {{- $bibhref := printf "%sBROWSE_LIBRARY.html#/book/%s" (safeURL ($c_prefix)) $destination }} - {{ $bibtitle := "" }} - {{ with $b.title }} - {{- $bibtitle = printf "%s" $b.title }} - {{ end }} - {{ .Page.Scratch.Add "bibs" (slice (slice $bibhref $bibtitle)) }} - {{- if not $text_link -}} - {{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}. bib⁄{{- $b.title -}}. {{- with $b.publisher -}}{{- . -}}.{{- end -}} - {{- else -}} - bib⁄{{- $text_link -}} - {{- end -}} - {{- else -}} - {{- $text_link -}}⦚bib:{{- $destination -}} not found - {{- end -}} -{{- else if in ($_.Get "triads") (index (split .Destination ":") 0) -}} - {{- if $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}} - {{- $session := $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}} - {{ .Page.Scratch.Add "links" (slice $session) }} - {{- if not $text_link -}} - {{- index (split .Destination ":") 0 -}}⁄{{- $session.Title -}} - {{- else -}} - {{- index (split .Destination ":") 0 -}}⁄{{- $text_link -}} - {{- end -}} - {{- else -}} - {{- $text_link -}}⦚{{- .Destination -}} not found - {{- end -}} -{{- else if strings.HasPrefix .Destination "audio:" -}} - {{- $a_destination := (substr .Destination 6) -}} - {{- if findRE "^.*static" $a_destination -}} - {{ .Text }} - {{- else -}} - {{ .Text }} - {{- end -}} -{{- else if findRE "^.*static" .Destination -}} - {{- .Text -}} -{{- else -}} - {{- .Text -}} -{{- end -}} diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index ed0b063..1c26e82 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1 +1 @@ -{{- .Page.Scratch.Add "urls" (slice .Destination) -}}{{- $t := .Text -}}{{- $sup := "" -}}{{- if and (strings.HasPrefix .Destination "{") (.Destination | strings.Count "}") -}}{{- range first 1 (split .Destination "}") -}}{{- range $frmt := (split (substr . 1) ",") -}}{{- if eq $frmt "sc" -}}{{- $t -}}{{- end -}}{{- end -}}{{- end -}}{{- else }}{{- if strings.HasPrefix .Destination "http" -}}{{- $sup = "www" -}}{{- end -}}{{- if strings.HasPrefix .Destination "#" -}}{{- $sup = "§" -}}{{- end -}}{{- $sup -}}⁄{{ .Text | safeHTML }}{{- end -}} \ No newline at end of file +{{- .Page.Scratch.Add "urls" (slice .Destination) -}}{{- $t := .Text -}}{{- $sup := "" -}}{{- if and (strings.HasPrefix .Destination "{") (.Destination | strings.Count "}") -}}{{- range first 1 (split .Destination "}") -}}{{- range $frmt := (split (substr . 1) ",") -}}{{- if eq $frmt "sc" -}}{{- $t -}}{{- end -}}{{- end -}}{{- end -}}{{- else }}{{- if strings.HasPrefix .Destination "http" -}}{{- $sup = "www" -}}{{- end -}}{{- if strings.HasPrefix .Destination "#" -}}{{- $sup = "§" -}}{{- end -}}{{- $sup -}}⁄{{ .Text | safeHTML }}{{- end -}} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 051e285..b23be44 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,13 +1,15 @@ - - - - {{- partial "head.html" . -}} - {{- .Title }} - {{ .Site.Title -}} - {{- partialCached "sandpointjs.html" . .RelPermalink -}} - - - {{- block "singlebody" . }}{{- end -}} + + + + + {{ block "title" . }}{{ site.Title | default "Sandpoints in progress..." }}{{ end }} + + + {{- block "main" . }}{{- end -}} {{- partialCached "footer.html" . -}} - + {{ if eq .RelPermalink "/mirror/ubu/" }} + {{ partial "deferred_global_graph.html" . }} + {{end}} + diff --git a/layouts/_default/list.html b/layouts/_default/list.html index d7c9011..ca5d61a 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,38 +1,21 @@ -{{ define "singlebody" }} - - {{ $currentNode := . }} - {{ $currentDir := "" }} - {{ with .File }} - {{ $currentDir = .Dir }} - {{ end }} - {{ $currentFile := (printf "/%s" .File) }} - {{ $editFile := $.Site.GetPage "/edit" }} - {{ $editFilePath := $editFile.RelPermalink }} - - -
Sitemap⁄{{ substr $.Site.Title 0 1 }}{{ substr $.Site.Title 1 }} {{with $currentDir}}({{ . }}){{ end }}
- - {{ $s := partialCached "scratch.html" . }} - {{ $noTriad := (slice) }} - {{ range $p := .Site.RegularPages }} - {{ $scratch := $s.Get (printf "/%s" $p.File) }} - {{ if eq $scratch.depth "core" }} -
- {{ range $coreKid := $scratch.has_children }} -
- {{ $scratchCKid := $s.Get (printf "/%s" $coreKid.File) }} - {{ range $mantleKid := $scratchCKid.has_children }} - - {{ end }} -
+ + + + + {{ .Title }} - {{ .Site.Title }} + + + +
+

{{ .Site.Title }}

+
+
+

{{ .Title }}

+
    + {{ range .Pages }} +
  • {{ .Title }}
  • {{ end }} - {{ else if not (in (slice "core" "mantle" "crust") $scratch.depth)}} - {{ $noTriad = $noTriad | append $p }} - {{ else }} -
- {{ end }} - {{ end }} - {{ range $noTriad }} -
{{- substr .File.Dir 0 -1 -}}⁄{{- .Title -}}{{ if not (or (hasPrefix .File.Dir "edit") (hasPrefix .File.Dir "print")) }}{{ end }}
- {{ end }} -{{ end }} + + + + diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7f12634..7b8680b 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,6 +1,7 @@ -{{- define "singlebody" -}} - {{- partialCached "header.html" . .RelPermalink -}} -

{{ .Title }}

- {{- partialCached "singlebody.html" . .RelPermalink -}} -
{{ .Content }}
-{{- end -}} +{{ define "main" }} + {{ partial "single-page-graph.html" . }} +
+

{{ .Title }}

+

{{ .Content }}

+
+{{ end }} diff --git a/layouts/edit/baseof.html b/layouts/edit/baseof.html deleted file mode 100644 index c0451ba..0000000 --- a/layouts/edit/baseof.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - edit⁄{{- .Site.Title -}} - - {{- block "main" . -}}{{- end -}} - diff --git a/layouts/edit/list.html b/layouts/edit/list.html deleted file mode 100644 index e4e4a83..0000000 --- a/layouts/edit/list.html +++ /dev/null @@ -1,2 +0,0 @@ -{{ define "main" }} -{{ end }} diff --git a/layouts/edit/single.html b/layouts/edit/single.html deleted file mode 100644 index 27f8f31..0000000 --- a/layouts/edit/single.html +++ /dev/null @@ -1 +0,0 @@ -{{- define "main" -}}{{- end -}} diff --git a/layouts/metadata/baseof.js.js b/layouts/metadata/baseof.js.js deleted file mode 100644 index df5fa0e..0000000 --- a/layouts/metadata/baseof.js.js +++ /dev/null @@ -1 +0,0 @@ -{{ block "main" . }}{{ end }} diff --git a/layouts/metadata/list.js.js b/layouts/metadata/list.js.js deleted file mode 100644 index 40d5ba3..0000000 --- a/layouts/metadata/list.js.js +++ /dev/null @@ -1,20 +0,0 @@ -{{- define "main" -}} - {{ $sections := (slice) }} - {{ $tiers := (slice) }} - {{ range $.Site.Sections }} - {{ with .File }} - {{ $sections = $sections | append (strings.TrimSuffix "/" .Dir) }} - {{ end }} - {{ end }} - {{ $metasp := (dict) }} - {{ range $k, $v := $.Site.Data.sandpointsnamegraph }} - {{ if in $sections $k }} - {{ $tiers = (slice) }} - {{ range where $.Site.RegularPages "Section" $k }} - {{ $tiers = $tiers | append (merge (dict "file" .File.LogicalName) (dict "title" .Title)) }} - {{ end }} - {{ $metasp = merge $metasp (dict $v (merge (dict "singular" $k) (dict "tiers" $tiers))) }} - {{ end }} - {{ end }} -{{ printf "METASP=%s;" (jsonify $metasp) }} -{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 90af05d..980f8a4 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,8 +1,13 @@ diff --git a/layouts/partials/head.html b/layouts/partials/head.html deleted file mode 100644 index 482f33d..0000000 --- a/layouts/partials/head.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - -{{ if .Description }} - -{{ end }} - -{{ if .Keywords }} - -{{ end }} - -{{ if .Params.editors }} - {{ range .Params.editors }} - {{ $e := $.GetPage (printf "editor/%s" .) }} - - {{ end }} -{{ end }} - -{{ if .Params.authors }} - {{ range .Params.authors }} - {{ $e := $.GetPage (printf "author/%s" .) }} - - {{ end }} -{{ end }} - - -{{ template "_internal/opengraph.html" . }} -{{ template "_internal/twitter_cards.html" . }} - -{{ hugo.Generator }} - - - - - - - -{{ if eq hugo.Environment "dev" }} - {{ $style := resources.Get "css/site.css" | resources.PostCSS (dict "config" "assets/css/postcss.config.js") | minify }} - - {{ $style := resources.Get "css/player.css" | resources.PostCSS (dict "config" "assets/css/postcss.config.js") | minify }} - -{{ else }} - - -{{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html deleted file mode 100644 index f21592a..0000000 --- a/layouts/partials/header.html +++ /dev/null @@ -1,114 +0,0 @@ -{{ $s := partialCached "scratch.html" . }} - -{{ $currentDir := "" }} -{{ with .File }} - {{ $currentDir = .Dir }} -{{ end }} - -{{ $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 "gitea" }} -
- EDIT_THIS - {{ with $scratch.core }}ADD_{{ index . 0 | upper }}{{ end }} - {{ with $scratch.mantle }}ADD_{{ index . 0 | upper }}{{ end }} - {{ with $scratch.crust }}ADD_{{ index . 0 | upper }}{{ end }} - {{ if not $scratch.core }}ADD_{{ substr $currentDir 0 -1 | upper }}{{ end }} - PUBLISH - ? -
-{{ else }} - {{ $editPage := $.Site.GetPage "/edit" }} -
- EDIT_THIS - {{ with $scratch.core }}ADD_{{ index . 0 | upper }}{{ end }} - {{ with $scratch.mantle }}ADD_{{ index . 0 | upper }}{{ end }} - {{ with $scratch.crust }}ADD_{{ index . 0 | upper }}{{ end }} - {{ if not $scratch.core }}ADD_{{ substr $currentDir 0 -1 | upper }}{{ end }} -
- -{{ end }} - -
- - - - -
diff --git a/layouts/partials/pagedjs.html b/layouts/partials/pagedjs.html deleted file mode 100644 index 1336d1d..0000000 --- a/layouts/partials/pagedjs.html +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/layouts/partials/printsinglebody.html b/layouts/partials/printsinglebody.html deleted file mode 100644 index 3786462..0000000 --- a/layouts/partials/printsinglebody.html +++ /dev/null @@ -1,96 +0,0 @@ -{{ $s := partialCached "scratch.html" . }} - -{{ $currentNode := . }} -{{ $currentDir := "" }} -{{ with .File }} - {{ $currentDir = .Dir }} -{{ end }} -{{ $currentFile := (printf "/%s" .File) }} -{{ $scratch := $s.Get $currentFile }} - -{{ $longestTitle := "" }} - -
{{ substr $currentDir 0 -1 }}⁄{{ .Title }}
- -
-
- {{ if ne (trim .Page.TableOfContents "\n") "" }} - {{ .Page.TableOfContents }} - {{ end }} -
-
- {{ $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 }} -
-
{{ with (index $currentNode.Params $mention) }}{{ if gt (len (index $currentNode.Params $mention)) 1 }}{{ $mention }}{{ else }}{{ substr $mention 0 -1 }}{{ end }}{{ end }}⁄
-
- {{ end }} -
- {{ .Title }}{{ with .Params.affiliation }}, {{ . }}{{ end }} -
- {{ end }} - {{ end }} - {{ end }} - {{- with $closeDivs -}}
{{ end }} - - {{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }} -
- {{ with $scratch.has }} -
has {{ $scratch.has }}⁄
- {{ end }} -
- {{ 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%s" $authors $prefix $authorPage.Title }} - {{ end }} - - {{ if gt (len .Title) (len $longestTitle) }} - {{ $longestTitle = .Title }} - {{ end }} - {{ end }} - -
- {{ end }} - - {{ if eq $scratch.depth "crust" }} -
-
in {{ index $scratch.in 1 }}⁄
-
- {{ range $scratch.is_in }} - - {{ end }} -
- {{ end }} -
-
- - -{{ with .Page.Params.abstract }}
abstract⁄{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}
{{ end }} - -{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}
keywords⁄{{- $v -}}{{- else -}}, {{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}
{{- end -}} diff --git a/layouts/partials/readdir.html b/layouts/partials/readdir.html deleted file mode 100644 index 04ed812..0000000 --- a/layouts/partials/readdir.html +++ /dev/null @@ -1,13 +0,0 @@ -{{ $parentName := . }} -{{ range (readDir .) }} - {{ $currentName := printf "%s/%s" $parentName .Name }} - {{ if .IsDir }} -

_Dir: {{ $currentName }}

- {{ partial "readdir.html" $currentName }} - {{ else }} - {{ if eq (path.Ext .Name) ".md" }} - {{ $f := readFile $currentName }} - - {{ end }} - {{ end }} -{{ end }} diff --git a/layouts/partials/sandpointjs.html b/layouts/partials/sandpointjs.html deleted file mode 100644 index ef9cf51..0000000 --- a/layouts/partials/sandpointjs.html +++ /dev/null @@ -1,4 +0,0 @@ - -{{ $sjsopts := dict "targetPath" "js/sandpoints.js" "minify" "true"}} -{{ $sjs := resources.Get "js/sandpoints.js" | js.Build $sjsopts }} - diff --git a/layouts/partials/scratch.html b/layouts/partials/scratch.html deleted file mode 100644 index c54a821..0000000 --- a/layouts/partials/scratch.html +++ /dev/null @@ -1,202 +0,0 @@ -{{ $currentNode := . }} - -{{ $_ := newScratch }} -{{ $debug := (slice) }} - -{{ $sandnameSingular := (slice) }} -{{ $sandnamePlural := (slice) }} - -{{ range $k, $v := $.Site.Data.sandpointsnamegraph }} - {{ $sandnameSingular = $sandnameSingular | append $k }} - {{ $sandnamePlural = $sandnamePlural | append $v }} -{{ end }} - -{{ $pPath := "" }} -{{ range $p := .Site.RegularPages }} - {{ $pPath = printf "/%s" $p.File }} - {{ $pageDir := "" }} - {{ with $p.File }} - {{ $pageDir = (substr .Dir 0 -1)}} - {{ end }} - - {{ $content := $p.Content }} - {{ with $links := $p.Scratch.Get "links" }} - {{ range $link := $links }} - {{ $linkPath := printf "/%s" $link.File}} - {{ with ($_.Get $linkPath) }} - {{ $_.SetInMap $linkPath "backlinks" (uniq ((index ($_.Get $linkPath) "backlinks") | append $p)) }} - {{ else }} - {{ $_.SetInMap $linkPath "backlinks" (slice $p) }} - {{ end }} - {{ end }} - {{ end }} - - {{ $paramsKeys := (slice) }} - {{ range $k, $v := $p.Params }} - {{ $paramsKeys = $paramsKeys | append $k }} - {{ end }} - - {{ $mentions := intersect $paramsKeys $sandnamePlural }} - {{ range $mention := $mentions }} - {{ range $m := index $p.Params $mention }} - {{ $mentionLink := printf "/%s/%s" (substr $mention 0 -1) $m }} - {{ with ($_.Get $mentionLink) }} - {{ $p.Scratch.Add "links" (uniq (($p.Scratch.Get "links")| append ($.GetPage $mentionLink))) }} - {{ $_.SetInMap $mentionLink "backlinks" (uniq ((index ($_.Get $mentionLink) "backlinks") | append $p)) }} - {{ else }} - {{ $p.Scratch.Add "links" (uniq (($p.Scratch.Get "links")| append ($.GetPage $mentionLink))) }} - {{ $_.SetInMap $mentionLink "backlinks" (slice $p) }} - {{ end }} - {{ end }} - {{ end }} - - {{ $gp := $.GetPage $pPath }} - {{ $gpPath := printf "/%s" $gp.File }} - {{ range $k, $v := $gp.Params }} - {{ with in $k "has_" }} - {{ $s := index (split $k "has_") 1 }} - {{ range $sin,$plur := $currentNode.Site.Data.sandpointsnamegraph }} - {{ if eq $s $plur }} - {{ range index $gp.Params $k }} - {{ $cp := $.GetPage (printf "/%s/%s" $sin .) }} - {{ $cpPath := printf "/%s" $cp.File }} - {{ range $kcp, $vcp := $cp.Params }} - {{ with in $kcp "has_" }} - {{ $scp := index (split $kcp "has_") 1 }} - {{ range $sincp,$plurcp := $currentNode.Site.Data.sandpointsnamegraph }} - {{ if eq $scp $plurcp }} - - {{ $_.SetInMap $gpPath "depth" "core" }} - {{ $_.SetInMap $gpPath "child_depth" "mantle" }} - {{ $_.SetInMap $gpPath "has" $s }} - - {{ with $gp.File }} - {{ $core := substr .Dir 0 -1 }} - {{ with index ($_.Get $gpPath) "core" }} - {{ $_.SetInMap $gpPath "core" (uniq ((index ($_.Get $gpPath) "core") | append $core)) }} - {{ else }} - {{ $_.SetInMap $gpPath "core" (slice $core) }} - {{ end }} - {{ $cor := $_.Get $cpPath }} - {{ with $cor.core }} - {{ $_.SetInMap $cpPath "core" (uniq ((index ($_.Get $cpPath) "core") | append $core)) }} - {{ else }} - {{ $_.SetInMap $cpPath "core" (slice $core) }} - {{ end }} - {{ end }} - - {{ with $cp.File }} - {{ $mantle := substr .Dir 0 -1 }} - {{ with index ($_.Get $gpPath) "mantle" }} - {{ $_.SetInMap $gpPath "mantle" (uniq ((index ($_.Get $gpPath) "mantle") | append $mantle)) }} - {{ else }} - {{ $_.SetInMap $gpPath "mantle" (slice $mantle) }} - {{ end }} - {{ with index ($_.Get $cpPath) "mantle" }} - {{ $_.SetInMap $cpPath "mantle" (uniq ((index ($_.Get $cpPath) "mantle") | append $mantle)) }} - {{ else }} - {{ $_.SetInMap $cpPath "mantle" (slice $mantle) }} - {{ end }} - {{ end }} - - {{ with $_.Get $gpPath }} - {{ if .has_children }} - {{ $hasChildren := index . "has_children" | append $cp }} - {{ $_.SetInMap $gpPath "has_children" (uniq $hasChildren) }} - {{ else }} - {{ $_.SetInMap $gpPath "has_children" (slice $cp) }} - {{ end }} - {{ end }} - - {{ $_.SetInMap $cpPath "depth" "mantle" }} - {{ $_.SetInMap $cpPath "child_depth" "crust" }} - {{ $_.SetInMap $cpPath "plural" $plur }} - {{ $_.SetInMap $cpPath "has" $scp }} - - {{ if isset $cp.Params $kcp }} - {{ $_.SetInMap $cpPath "has_children" (slice) }} - {{ with index ($_.Get $cpPath) "is_in" }} - {{ $isincore := index ($_.Get $cpPath) "is_in" | append $gp}} - {{ $_.SetInMap $cpPath "is_in" (uniq $isincore) }} - {{ else }} - {{ $_.SetInMap $cpPath "is_in" (slice $gp) }} - {{ end }} - {{ end }} - - {{ range index $cp.Params $kcp }} - {{ $gcp := $.GetPage (printf "/%s/%s" $sincp .) }} - {{ $gcpPath := printf "/%s" $gcp.File }} - - {{ with $_.Get $cpPath }} - {{ if .has_children }} - {{ $hasGChildren := index . "has_children" | append $gcp }} - {{ $_.SetInMap $cpPath "has_children" (uniq $hasGChildren) }} - {{ else }} - {{ $_.SetInMap $cpPath "has_children" (slice $gcp) }} - {{ end }} - {{ end }} - - {{ $_.SetInMap $gcpPath "depth" "crust" }} - {{ $_.SetInMap $gcpPath "plural" $plurcp }} - {{ $_.SetInMap $gcpPath "in" (slice $sin $plur) }} - - {{ with $gp.File }} - {{ $core := substr .Dir 0 -1 }} - {{ with index ($_.Get $gcpPath) "core" }} - {{ $_.SetInMap $gcpPath "core" (uniq ((index ($_.Get $gcpPath) "core") | append $core)) }} - {{ else }} - {{ $_.SetInMap $gcpPath "core" (slice $core) }} - {{ end }} - {{ end }} - - {{ with $cp.File }} - {{ $mantle := substr .Dir 0 -1 }} - {{ with index ($_.Get $gcpPath) "mantle" }} - {{ $_.SetInMap $gcpPath "mantle" (uniq ((index ($_.Get $gcpPath) "mantle") | append $mantle)) }} - {{ else }} - {{ $_.SetInMap $gcpPath "mantle" (slice $mantle) }} - {{ end }} - {{ end }} - - {{ with $gcp.File }} - {{ $crust := substr .Dir 0 -1 }} - {{ with index ($_.Get $gpPath) "crust" }} - {{ $_.SetInMap $gpPath "crust" (uniq ((index ($_.Get $gpPath) "crust") | append $crust)) }} - {{ else }} - {{ $_.SetInMap $gpPath "crust" (slice $crust) }} - {{ end }} - {{ with index ($_.Get $cpPath) "crust" }} - {{ $_.SetInMap $cpPath "crust" (uniq ((index ($_.Get $cpPath) "crust") | append $crust)) }} - {{ else }} - {{ $_.SetInMap $cpPath "crust" (slice $crust) }} - {{ end }} - {{ with index ($_.Get $gcpPath) "crust" }} - {{ $_.SetInMap $gcpPath "crust" (uniq ((index ($_.Get $gcpPath) "crust") | append $crust)) }} - {{ else }} - {{ $_.SetInMap $gcpPath "crust" (slice $crust) }} - {{ end }} - {{ end }} - - {{ with $_.Get $gcpPath }} - {{ if .is_in }} - {{ $isinmantle := index . "is_in" | append $cp}} - {{ $_.SetInMap $gcpPath "is_in" (uniq $isinmantle) }} - {{ else }} - {{ $_.SetInMap $gcpPath "is_in" (slice $cp) }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} - - {{ $_.SetInMap $pPath "debug" (printf "%#v" $debug) }} -{{ end }} - -{{ return $_ }} diff --git a/layouts/partials/singlebody.html b/layouts/partials/singlebody.html deleted file mode 100644 index 45392cd..0000000 --- a/layouts/partials/singlebody.html +++ /dev/null @@ -1,105 +0,0 @@ -{{ $s := partialCached "scratch.html" . }} - -{{ $currentNode := . }} -{{ $currentDir := "" }} -{{ with .File }} - {{ $currentDir = .Dir }} -{{ end }} -{{ $currentFile := (printf "/%s" .File) }} -{{ $scratch := $s.Get $currentFile }} - -{{ $sandnamePlural := (slice) }} -{{ $sandnameSingular := "" }} -{{ $mentionLink := "" }} - -
{{ substr $currentDir 0 -1 }}⁄{{ substr .Title 0 1 }}{{ substr .Title 1 }}
- -
-
- {{ if ne (trim .Page.TableOfContents "\n") "" }} - {{ .Page.TableOfContents }} - {{ end }} -
-
- {{ $closeDivs := false }} - - {{ 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 }} - {{ range $k, $v := $.Site.Data.sandpointsnamegraph }} - {{ if eq $v $mention }} - {{ $mentionLink = printf "/%s/%s" $k $m }} - {{ $sandnameSingular = $k }} - {{ end }} - {{ end }} - {{- with $.GetPage $mentionLink -}} - {{- with not $k -}} - {{ $closeDivs = true }} -
-
{{ with (index $currentNode.Params $mention) }}{{ if gt (len (index $currentNode.Params $mention)) 1 }}{{ $mention }}{{ else }}{{ $sandnameSingular }}{{ end }}{{ end }}⁄
-
- {{- end -}} -
- {{ .Title }}{{ with .Params.affiliation }}, {{ . }}{{ end }} -
- {{- end -}} - {{ end }} - {{- with $closeDivs -}}
{{ end }} - {{ end }} - - {{ if in .Page.Site.Params.sandpointsMentionedIn (substr $currentDir 0 -1) }} -
- {{ with $scratch.backlinks }} -
mentioned in⁄
- {{ end }} -
- {{ range $scratch.backlinks }} - - {{ end }} -
- {{ end }} - - {{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }} -
- {{ with $scratch.has }} -
has {{ $scratch.has }}⁄
- {{ end }} -
- {{ range $scratch.has_children }} - - {{ end }} -
- {{ end }} - - {{ if eq $scratch.depth "crust" }} -
-
in {{ index $scratch.in 1 }}⁄
-
- {{ range $scratch.is_in }} - - {{ end }} -
- {{ end }} -
-
- - -{{ with .Page.Params.abstract }}
abstract⁄{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}
{{ end }} - -{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}
keywords⁄{{- $v -}}{{- else -}}, {{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}
{{- end -}} - -{{ $var := printf "repo={\"frontmatter\": %s, \"content\": %s, \"path\": \"%s\", \"relpermalink\": \"%s\" }" (jsonify .Params) (jsonify .RawContent) .File.Path .RelPermalink | resources.FromString (printf "js/repo/%s.js" .File.UniqueID) }} -{{ $dummy := $var.Permalink }} diff --git a/layouts/print/baseof.html b/layouts/print/baseof.html deleted file mode 100644 index 3a88dcf..0000000 --- a/layouts/print/baseof.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - {{- partial "head.html" . -}} - {{- partial "pagedjs.html" . -}} - - - {{- block "singlebody" . -}}{{- end -}} - - diff --git a/layouts/print/single.html b/layouts/print/single.html deleted file mode 100644 index a074dd8..0000000 --- a/layouts/print/single.html +++ /dev/null @@ -1,113 +0,0 @@ -{{- define "singlebody" -}} - {{ $cssOutput := "" }} - {{ $cssHashes := "" }} - - {{ $s := partialCached "scratch.html" . }} - {{ $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 }} - {{ end }} - -
{{ partial "printsinglebody.html" $p }}
-
{{ $p.Content }}
- - {{ range $scratch.has_children }} -
- {{ $addS := 0 }} - {{ 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 }} -
author{{ with (gt $addS 1) }}s{{ end }}⁄{{ $author.Title }} - {{ else }} - , {{ $author.Title }} - {{ end }} - {{ end }} - {{ with .Params.authors }}
{{ end }} - - {{ $tit := .Title }} - {{ if gt (len .Title) 54 }} - {{ $tit = printf "%s…" (substr .Title 0 50) }} - {{ end }} -
{{ index $scratch.crust 0 }}⁄{{ $tit }}
- {{ partial "printsinglebody.html" . }} - {{ .Content }} - {{ $kid := $s.Get (printf "/%s" .File) }} - {{ range $kid.has_children }} -
- {{ $addS := 0 }} - {{ with .Params.authors }} - {{ $addS = len . }} - {{ end }} - {{ range $n, $authorFile := .Params.authors }} - {{ $author := $.GetPage (printf "/author/%s" $authorFile) }} - {{ if eq $n 0 }} -
author{{ with (gt $addS 1) }}s{{ end }}⁄{{ $author.Title }} - {{ else }} - , {{ $author.Title }} - {{ end }} - {{ end }} - {{ with .Params.authors }}
{{ end }} - - {{ $tit := .Title }} - {{ if gt (len .Title) 54 }} - {{ $tit = printf "%s…" (substr .Title 0 50) }} - {{ end }} -
{{ index $scratch.crust 0 }}⁄{{ $tit }}
- {{ partial "printsinglebody.html" . }} - {{ .Content }} - {{ end }} - {{ end }} - - {{ range union (uniq $editorsPages) (uniq $authorsPages) }} -
-
{{ index $scratch.mantle 0 }}⁄{{ $p.Title }}
-
{{ substr .File.Dir 0 -1 }}⁄{{ .Title }}
- {{ .Content }} - - {{ 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 }} -
- {{ end }} - {{ end }} -{{- end -}} diff --git a/layouts/shortcodes/gloss.html b/layouts/shortcodes/gloss.html deleted file mode 100644 index b90c4c3..0000000 --- a/layouts/shortcodes/gloss.html +++ /dev/null @@ -1,25 +0,0 @@ -{{ $inn := .Inner | $.Page.RenderString }} -
-
- {{- range $g := (split $inn "\n") -}} - {{- if hasPrefix $g "{r}" -}} -
- {{- substr $g 3 | htmlUnescape | safeHTML -}} -
- {{- else if hasPrefix $g "{g}" -}} -
- {{- range (split (substr $g 3) "|") -}} - {{- with . -}} -
- {{- range (split . "," ) -}} -
{{- . | htmlUnescape | safeHTML -}}
- {{- end -}} -
- {{- end -}} - {{- end -}} -
- {{- end -}} - {{- end -}} -
-
{{ with .Get 0 }}{{ . }}{{ end}}
-
diff --git a/layouts/shortcodes/nosup.html b/layouts/shortcodes/nosup.html deleted file mode 100644 index b8a8f8b..0000000 --- a/layouts/shortcodes/nosup.html +++ /dev/null @@ -1 +0,0 @@ -{{ with .Inner }} {{ $.Page.RenderString . }} {{ end }} diff --git a/layouts/shortcodes/soundcloud.html b/layouts/shortcodes/soundcloud.html deleted file mode 100644 index a26db5b..0000000 --- a/layouts/shortcodes/soundcloud.html +++ /dev/null @@ -1,10 +0,0 @@ -{{ $id := index .Params 0 }} -{{ $type := index .Params 1 | default "track" }} - diff --git a/layouts/taxonomy/baseof.html b/layouts/taxonomy/baseof.html deleted file mode 100644 index ff6a2c7..0000000 --- a/layouts/taxonomy/baseof.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - {{- partialCached "head.html" . -}} - {{- .Title }} - {{ .Site.Title -}} - {{- partialCached "sandpointjs.html" . .RelPermalink -}} - - - {{- block "keywords" . -}}{{- end -}} - {{- partialCached "footer.html" . -}} - - diff --git a/layouts/taxonomy/list.html b/layouts/taxonomy/list.html deleted file mode 100644 index e70e8e3..0000000 --- a/layouts/taxonomy/list.html +++ /dev/null @@ -1,23 +0,0 @@ -{{ define "keywords" }} - {{ $p := split (trim .RelPermalink "/") "/" }} - {{ if eq (len $p) 1 }} -
{{ index $p 0 }}⁄All
- {{ range $taxonomyname, $taxonomy := .Site.Taxonomies }} - {{ if eq (index $p 0) $taxonomyname }} - {{ range $key, $value := $taxonomy }} - {{ $key }}({{ len (index (index $.Site.Taxonomies $taxonomyname) $key) }}) - {{ end }} - {{ end }} - {{ end }} - {{ else }} -
{{ index $p 0 }}⁄{{ index $p 1 }}
- {{ range .Pages.ByDate.Reverse }} -
{{ .Date.Format "Jan 2, 2006" }}
- - {{ range $n, $authorFile := .Params.authors }} - {{ $author := $.GetPage (printf "/author/%s" $authorFile) }} - {{ $author.Title }} - {{ end }} - {{ end }} - {{ end }} -{{ end }} diff --git a/layouts/urls/baseof.html b/layouts/urls/baseof.html deleted file mode 100644 index 85953ac..0000000 --- a/layouts/urls/baseof.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - {{- partialCached "head.html" . -}} - {{- .Title }} - {{ .Site.Title -}} - {{- partialCached "sandpointjs.html" . .RelPermalink -}} - - - {{ block "urls" . }}{{ end }} - {{- partialCached "footer.html" . -}} - - diff --git a/layouts/urls/list.html b/layouts/urls/list.html deleted file mode 100644 index 2764d59..0000000 --- a/layouts/urls/list.html +++ /dev/null @@ -1,104 +0,0 @@ -{{ define "urls" }} -

Backlinks, outgoing URLs, bibliographic references and internal links:

- {{ $s := partialCached "scratch.html" . }} - - -

- {{ range $p := .Site.RegularPages }} -
{{ with $p.File }}{{- substr .Dir 0 -1 -}}⁄{{ end }}{{ $p.Title }} - - {{ $pPath := printf "/%s" $p.File }} - {{ with $ss := $s.Get $pPath }} - {{ with $ss.backlinks }} - {{ range $i, $_ := $ss.backlinks }} - {{ if eq $i 0 }} -
Mentioned in other Sandpoints pages ({{ len $ss.backlinks }}):
    - {{ end }} -
  • {{ with $_.File }}{{ substr .Dir 0 -1 }}⁄{{ end }}{{ $_.Title }}
  • - {{ end }} -
- {{ end }} - {{ end }} - - {{ with ($p.Scratch.Get "links") }} - {{ range $i, $_ := uniq ($p.Scratch.Get "links") }} - {{ if eq $i 0 }} -
Internal links to other Sandpoint pages ({{ len (uniq ($p.Scratch.Get "links")) }}):
    - {{ end }} -
  • {{ with $_.File }}{{ substr .Dir 0 -1 }}⁄{{ end }}{{ $_.Title }}
  • - {{ end }} -
- {{ end }} - - {{ $http_links := (slice) }} - {{ $library_links := (slice) }} - {{ $anchor_links := (slice) }} - {{ $other_links := (slice) }} - - {{ with ($p.Scratch.Get "urls") }} - {{- $c_prefix := $p.Site.Params.sandpointsCatalogPrefix | default "/library/" -}} - {{ range $i, $_ := ($p.Scratch.Get "urls") }} - {{ if strings.HasPrefix $_ "http" }} - {{ $http_links = $http_links | append $_ }} - {{ else if strings.HasPrefix $_ $c_prefix }} - {{ $library_links = $library_links | append $_ }} - {{ else}} - {{ $other_links = $other_links | append $_ }} - {{ end }} - {{ end }} - {{ end }} - - {{ with $http_links }} - {{ range $i, $_ := $http_links }} - {{ if eq $i 0 }} -
Outgoing links to other pages on Internet ({{ len $http_links }}):
    - {{ end }} -
  • www⁄{{ $_ }}
  • - {{ end }} -
- {{ end }} - - {{ with $library_links }} - {{ range $i, $_ := $library_links }} - {{ if eq $i 0 }} -
Links to Sandpoint's library ({{ len $library_links }}):
    - {{ end }} -
  • lib⁄{{ $_ }}
  • - {{ end }} -
- {{ end }} - - {{ with ($p.Scratch.Get "bibs") }} - {{ range $i, $_ := ($p.Scratch.Get "bibs") }} - {{ if eq $i 0 }} -
Bibliographic references ({{ len ($p.Scratch.Get "bibs") }}):
- {{ end }} - - {{ with $other_links }} - {{ $formattingN := 0 }} - {{ $anchorN := 0 }} - {{ range $i, $_ := $other_links }} - {{ if eq $i 0 }} -
Anchor, formatting and other links ({{ len $other_links }}):
    - {{ end }} - {{ if strings.HasPrefix $_ "#" }} - {{ $anchorN = add $anchorN 1 }} - {{ else if strings.HasPrefix $_ "{"}} - {{ $formattingN = add $formattingN 1 }} - {{ else }} -
  • other⁄{{ $_ }}
  • - {{ end }} - {{ end }} - {{ with $formattingN }}
  • {{ $formattingN }} formatting links.
  • {{ end }} - {{ with $anchorN }}
  • {{ $anchorN }} anchor links.
  • {{ end }} -
- {{ end }} - -
- - {{ end }} -{{ end }}