couldhave array in repo variable contains possible autocomplete list of children

master
Marcell Mars 3 years ago
parent b167e218a9
commit abcee4d0f5

@ -10,6 +10,9 @@
{{ $sandnamePlural := (slice) }}
{{ $couldHaveSection := "" }}
{{ $couldHave := (slice)}}
<div class="{{ $scratch.depth | default "crust" }}title"><span class="supt">{{ substr $currentDir 0 -1 }}{{ substr .Title 0 1 }}</span>{{ substr .Title 1 }}</div></div>
<div class="grid">
@ -23,6 +26,9 @@
{{ 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 }}
@ -94,5 +100,11 @@
{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}<div class="keywords"><span class="sup">keywords</span>{{- $v -}}{{- else -}},&nbsp;{{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- 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) }}
{{ 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) }}
{{ $dummy := $var.Permalink }}

Loading…
Cancel
Save