{{- define "main" -}}
  {{ $sections := (slice)  }}
  {{ $tiers := (slice)  }}
  {{ range $.Site.Sections }}
    {{ with .File  }}
      {{ $sections = $sections | append (strings.TrimSuffix "/" .Dir) }}
    {{ end  }}
  {{ end  }}
  {{ $metasp := (dict) }}
  {{ range $k, $v := $.Site.Data.sandpointsnamegraph }}
    {{ if in $sections $k }}
      {{ $tiers = (slice)  }}
      {{ range where $.Site.RegularPages "Section" $k }}
        {{ $tiers = $tiers | append (merge (dict "file" .File.LogicalName) (dict "title" .Title)) }}
      {{ end }}
      {{ $metasp = merge $metasp (dict $v (merge (dict "singular" $k) (dict "tiers" $tiers))) }}
    {{ end  }}
  {{ end  }}
{{ printf "METASP=%s;" (jsonify $metasp) }}
{{ end }}
