{{ define "main" }} {{$currentNode := . }} {{ $graphOptions := newScratch }} {{ range $k, $v := $.Site.Data.sandpointsnamegraph }} {{ if eq (substr $currentNode.File.Dir 0 -1) $k }} {{ $graphOptions.Set "plural" (index $v "plural") }} {{ $graphOptions.Set "depth" (index $v "depth") }} {{ with index $v "in" }} {{ $graphOptions.Set "in" (index $v "in") }} {{ end }} {{ with index $v "has" }} {{ $graphOptions.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 ($graphOptions.Get "depth") "crust")) }}
has {{ index ($graphOptions.Get "has") 1 }}⁄
{{ range index $currentNode.Params (printf "has_%s" (index ($graphOptions.Get "has") 1) )}} {{ with $.GetPage (printf "%s%s" (printf "/%s/" (index ($graphOptions.Get "has") 0)) . ) }} {{ end }} {{ end }} {{ end }} {{ if eq ($graphOptions.Get "depth") "crust" }}
in {{ index ($graphOptions.Get "in") 1 }}⁄
{{ range where $.Site.RegularPages ".Section" (index ($graphOptions.Get "in") 0) }} {{ if in (index .Params (printf "has_%s" ($graphOptions.Get "plural"))) $currentNode.File.LogicalName }} {{ else if in $currentNode.Params.is_in .File.LogicalName }} {{ end }} {{ end }} {{ end }}
{{ .Content }}
{{ end }}