diff --git a/layouts/edit/baseof.html b/layouts/edit/baseof.html index bde39ab..c0451ba 100644 --- a/layouts/edit/baseof.html +++ b/layouts/edit/baseof.html @@ -6,6 +6,7 @@ + edit⁄{{- .Site.Title -}} diff --git a/layouts/metadata/list.js.js b/layouts/metadata/list.js.js index 36f0227..f51cede 100644 --- a/layouts/metadata/list.js.js +++ b/layouts/metadata/list.js.js @@ -1 +1,20 @@ -{{ define "main" }}METASP=[{{ range .Site.Sections }}{"section": "{{ with .File }}{{ trim .Dir "/" }}{{ end }}", "items": [{{ range .Pages }}"{{ .File.BaseFileName }}", {{ end }}]}, {{ end }}];{{ end }} +{{- 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 .File.LogicalName }} + {{ 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/singlebody.html b/layouts/partials/singlebody.html index 8eebe18..9075098 100644 --- a/layouts/partials/singlebody.html +++ b/layouts/partials/singlebody.html @@ -10,9 +10,6 @@ {{ $sandnamePlural := (slice) }} -{{ $couldHaveSection := "" }} -{{ $couldHave := (slice)}} -
{{ substr $currentDir 0 -1 }}⁄{{ substr .Title 0 1 }}{{ substr .Title 1 }}
@@ -26,9 +23,6 @@ {{ range $k, $v := $.Site.Data.sandpointsnamegraph }} {{ $sandnamePlural = $sandnamePlural | append $v }} - {{ if eq $scratch.has $v }} - {{ $couldHaveSection = $k }} - {{ end }} {{ end }} {{ $paramsKeys := (slice) }} {{ range $k, $v := $currentNode.Params }} @@ -100,11 +94,5 @@ {{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}
keywords⁄{{- $v -}}{{- else -}}, {{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}
{{- end -}} -{{ if $couldHaveSection }} - {{ range where .Site.RegularPages "Section" $couldHaveSection }} - {{ $couldHave = $couldHave | append .File.LogicalName }} - {{ end }} -{{ end }} - -{{ $var := printf "repo={\"frontmatter\": %s, \"content\": %s, \"path\": \"%s\", \"relpermalink\": \"%s\", \"couldhave\": %s }" (jsonify .Params) (jsonify .RawContent) .File.Path .RelPermalink (jsonify $couldHave)| resources.FromString (printf "js/repo/%s.js" .File.UniqueID) }} +{{ $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 }}