{{ $currentSession := . }} {{ $_ := newScratch }} {{- range $k, $v := .Page.Site.Data.sandpointsnamegraph -}} {{ if eq $currentSession.File.Dir (printf "%s/" $k) }} {{ $_.Add "depth" (index $v "depth") }} {{ if eq (index $v "depth") "mantle" }} {{ $_.Add "home" (index $v "in" 0) }} {{ end }} {{ if eq (index $v "depth") "crust" }} {{ $_.Add "home" (index (index $currentSession.Site.Data.sandpointsnamegraph (index $v "in" 0)) "in" 0) }} {{ $_.Add "mantle" (index $v "in" 0) }} {{ $_.Add "mantle_has" (index (index $currentSession.Site.Data.sandpointsnamegraph (index $v "in" 0)) "has" 1) }} {{ end }} {{ end }} {{- end -}}