Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
|
- {{ $currentNode := . }}
-
- {{ range $p := .Site.RegularPages }}
- {{ $pageFilePath := printf "/%s" $p.File }}
- {{ $pageDir := "" }}
- {{ with $p.File }}
- {{ $pageDir = (substr .Dir 0 -1)}}
- {{ end }}
-
- {{ range $triad := (index $currentNode.Site.Data.sandpointsnamegraph "triads") }}
- {{ with intersect $triad (slice $pageDir) }}
- {{ $t := index . 0 }}
- {{ if eq $t (index $triad 0) }}
- {{ $.Scratch.SetInMap $pageFilePath "depth" "core" }}
- {{ $.Scratch.SetInMap $pageFilePath "child_depth" "mantle" }}
- {{ $.Scratch.SetInMap $pageFilePath "plural" (index $triad 1)}}
- {{ $.Scratch.SetInMap $pageFilePath "has" (slice (index $triad 2) (index $triad 3))}}
-
- {{ $gp := $.GetPage $pageFilePath }}
- {{ $hasmantles := (slice) }}
- {{ range index $gp.Params (printf "has_%s" (index $triad 3)) }}
- {{ $hasmantles = $hasmantles | append ($.GetPage (printf "/%s/%s" (index $triad 2) . )) }}
- {{ end }}
- {{ $.Scratch.SetInMap $pageFilePath "has_children" $hasmantles }}
-
- {{ range index $p.Params (printf "has_%s" (index $triad 3)) }}
- {{ $childPath := printf "/%s/%s" (index $triad 2) . }}
- {{ with $.Scratch.Get $childPath }}
- {{ if isset . "is_in" }}
- {{ $isin := index . "is_in" | append ($.GetPage $pageFilePath) }}
- {{ $.Scratch.SetInMap $childPath "is_in" $isin }}
- {{ else }}
- {{ $.Scratch.SetInMap $childPath "is_in" (slice ($.GetPage $pageFilePath)) }}
- {{ end }}
- {{ else }}
- {{ $.Scratch.SetInMap $childPath "is_in" (slice ($.GetPage $pageFilePath)) }}
- {{ end }}
- {{ end }}
- {{ else if eq $t (index $triad 2) }}
- {{ $.Scratch.SetInMap $pageFilePath "depth" "mantle" }}
- {{ $.Scratch.SetInMap $pageFilePath "child_depth" "crust" }}
- {{ $.Scratch.SetInMap $pageFilePath "plural" (index $triad 3)}}
- {{ $.Scratch.SetInMap $pageFilePath "has" (slice (index $triad 4) (index $triad 5))}}
-
- {{ $gp := $.GetPage $pageFilePath }}
- {{ $hascrusts := (slice) }}
- {{ range index $gp.Params (printf "has_%s" (index $triad 5)) }}
- {{ $hascrusts = $hascrusts | append ($.GetPage (printf "/%s/%s" (index $triad 4) . )) }}
- {{ end }}
- {{ $.Scratch.SetInMap $pageFilePath "has_children" $hascrusts }}
-
- {{ range index $p.Params (printf "has_%s" (index $triad 5)) }}
- {{ $childPath := printf "/%s/%s" (index $triad 4) . }}
- {{ with $.Scratch.Get $childPath }}
- {{ if isset . "is_in" }}
- {{ $isin := index . "is_in" | append ($.GetPage $pageFilePath) }}
- {{ $.Scratch.SetInMap $childPath "is_in" $isin }}
- {{ else }}
- {{ $.Scratch.SetInMap $childPath "is_in" (slice ($.GetPage $pageFilePath)) }}
- {{ end }}
- {{ else }}
- {{ $.Scratch.SetInMap $childPath "is_in" (slice ($.GetPage $pageFilePath)) }}
- {{ end }}
- {{ end }}
-
- {{ else if eq $t (index $triad 4) }}
- {{ $.Scratch.SetInMap $pageFilePath "depth" "crust" }}
- {{ $.Scratch.SetInMap $pageFilePath "mantle_has" (index $triad 5) }}
- {{ $.Scratch.SetInMap $pageFilePath "plural" (index $triad 5)}}
- {{ $.Scratch.SetInMap $pageFilePath "in" (slice (index $triad 2) (index $triad 3))}}
- {{ end }}
-
- {{ $.Scratch.SetInMap $pageFilePath "core" (index $triad 0) }}
- {{ $.Scratch.SetInMap $pageFilePath "mantle" (index $triad 2) }}
- {{ $.Scratch.SetInMap $pageFilePath "crust" (index $triad 4) }}
- {{ end }}
- {{ end }}
- {{ end }}
-
- {{ return $.Scratch }}
|