Files
vanilla-hugo/layouts/_partials/uniquebyseries.html
2026-05-18 21:15:19 -07:00

15 lines
514 B
HTML

{{- $pages := slice -}}
{{- $tmpScratch := newScratch -}}
{{- range $post := (where (where site.Pages.ByDate.Reverse "Section" "blog") ".Kind" "!=" "section") -}}
{{- $term := index ($post.GetTerms "series") 0 -}}
{{- if (and $term (not ($term.Param "donotunique"))) -}}
{{- if not ($tmpScratch.Get $term.Permalink) -}}
{{- $tmpScratch.Set $term.Permalink true -}}
{{- $pages = $pages | append $post -}}
{{- end -}}
{{- else -}}
{{- $pages = $pages | append $post -}}
{{- end -}}
{{- end -}}
{{- return $pages -}}