{{- $works := index hugo.Data (.Get "corpus") }} {{- $collections := index hugo.Data (.Get "collections") }} {{- $creators := index hugo.Data (.Get "creators") }}
{{- range $work := sort (where (where $works "collection" nil) "parent" nil) "title" "asc" }} {{ partial "work.html" (dict "work" $work "works" $works "creators" $creators) }} {{- end }}
{{- range $collection := $collections }}

{{ $collection.title }}

{{- range $work := where $works "collection" $collection.id }} {{ partial "work.html" (dict "work" $work "works" $works "creators" $creators) }} {{- end }}
{{- end }}