{{ define "main" }} {{$currentNode := . }} {{ range $k, $v := $.Site.Data.sandpointsnamegraph }} {{ if eq (substr $currentNode.File.Dir 0 -1) $k }} {{ $.Scratch.Set "plural" (index $v "plural") }} {{ $.Scratch.Set "depth" (index $v "depth") }} {{ with index $v "in" }} {{ $.Scratch.Set "in" (index $v "in") }} {{ end }} {{ with index $v "has" }} {{ $.Scratch.Set "has" (index $v "has") }} {{ end }} {{ end }} {{ end }}
{{ substr .File.Dir 0 -1 }}⁄{{ substr .Title 0 1 }}{{ substr .Title 1 }}
{{ if ne (trim .Page.TableOfContents "\n") "" }} {{ .Page.TableOfContents }} {{ end }}
{{ if (not (eq ($.Scratch.Get "depth") "crust")) }}
has {{ index ($.Scratch.Get "has") 1 }}⁄
{{ range index $currentNode.Params (printf "has_%s" (index ($.Scratch.Get "has") 1) )}} {{ with $.GetPage (printf "%s%s" (printf "/%s/" (index ($.Scratch.Get "has") 0)) . ) }} {{ end }} {{ end }} {{ end }} {{ if eq ($.Scratch.Get "depth") "crust" }}
in {{ index ($.Scratch.Get "in") 1 }}⁄
{{ range where $.Site.RegularPages ".Section" (index ($.Scratch.Get "in") 0) }} {{ if in (index .Params (printf "has_%s" ($.Scratch.Get "plural"))) $currentNode.File.LogicalName }} {{ else if in $currentNode.Params.is_in .File.LogicalName }} {{ end }} {{ end }} {{ end }}
{{ .Content }}
{{ end }}