{{- with hugo.Data.works }}
{{- $works := . }}
{{- range $work := sort (where (where $works "collection" nil) "parent" nil) "title" "asc" }}
- {{ $work.title }} by {{ delimit $work.authors ", " }}
-
{{ $work.description | markdownify }}
{{- $subworks := where $works "parent" "eq" $work.title }}
{{- if gt (len $subworks) 0 }}
Associated works
{{- range $subwork := where $works "parent" "eq" $work.title }}
- {{ $subwork.title }} by {{ delimit $subwork.authors ", " }}
-
{{ $subwork.description | markdownify }}
{{- end }}
{{- end }}
{{- end }}
{{- range $collection := hugo.Data.collections }}
{{ $collection.title }}
{{- range $work := where $works "collection" $collection.id }}
- {{ $work.title }} by {{ delimit $work.authors ", " }}
-
{{ $work.description | markdownify }}
{{- $subworks := where $works "parent" "eq" $work.title }}
{{- if gt (len $subworks) 0 }}
Associated works
{{- range $subwork := where $works "parent" "eq" $work.title }}
- {{ $subwork.title }} by {{ delimit $subwork.authors ", " }}
-
{{ $subwork.description | markdownify }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}