diff --git a/layouts/_default/list.html b/layouts/_default/list.html index b4efb67..90e5b66 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -42,8 +42,17 @@ {{ end }} - {{ $subsections := .Sections }} - {{ with $subsections }} + {{- $subsections := .Sections -}} + {{- $pages := .Pages | complement $subsections -}} + + {{- if eq (len $pages) 0 -}} + {{/* If there are no normal pages, display subsections in list style, with pagination */}} + {{/* This happens with taxonomies like categories or tags */}} + {{- $pages = $subsections -}} + {{- $subsections = slice -}} + {{- end -}} + + {{- with $subsections -}}

{{ T "list.subsection" (len $subsections) }}

@@ -52,10 +61,10 @@ {{ end }}
- {{ end }} + {{- end -}} {{/* List only pages that are not a subsection */}} - {{ $paginator := .Paginate (.Pages | complement $subsections) }} + {{ $paginator := .Paginate $pages }}
{{ range $paginator.Pages }} {{ partial "article-list/compact" . }}