From 3bdcf7ee60228685e48a5ec467e67463cc340135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Mon, 18 May 2026 19:05:34 +0200 Subject: [PATCH] Fix /categories and /tags overview pages: render term cards with images For kind=taxonomy pages, .Pages contains term pages (not posts), so card.html was getting no images. Add a separate branch that renders each term as a cover card using the first post's image, title, and plate count. Co-Authored-By: Claude Sonnet 4.6 --- layouts/_default/list.html | 61 ++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 9 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index de4a300..45cf02d 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,14 +1,55 @@ {{ define "main" }} -{{/* Category / tag taxonomy list pages */}} + +{{- if eq .Kind "taxonomy" }} +{{/* ── Taxonomy overview: /categories/ or /tags/ ── */}}
- {{- if eq .Kind "taxonomy" }} -
{{ .Type | humanize }}
-

{{ .Title }}

-

- {{ len .Pages }} {{ if eq (len .Pages) 1 }}plate{{ else }}plates{{ end }} in this section. - Return to archive → -

- {{- else if eq .Kind "term" }} +
Archive
+

The {{ .Title | lower }}

+

+ {{ len .Pages }} {{ .Title | lower | singularize }}{{ if ne (len .Pages) 1 }}s{{ end }} across the archive. + Return to home → +

+
+ +
+ {{- range $i, $term := .Pages }} + {{- $firstPost := index $term.Pages 0 }} + {{- $img := "" }} + {{- if $firstPost }}{{- $img = $firstPost.Resources.GetMatch "*.png" }}{{- end }} + +
+ {{- if $img }} + {{- $w := $img.Resize "600x900 webp" }} + + + {{ $term.Title }} + + {{- end }} + {{ len $term.Pages }} plates +
+
+

{{ $term.Title }}

+
+
+ {{- end }} +
+ +{{- else }} +{{/* ── Term page (/categories/gothic/) or plain list ── */}} +
+ {{- if eq .Kind "term" }}
{{ .Type | humanize | singularize }}

{{ .Title }}

@@ -34,4 +75,6 @@ {{- end }}

{{- partial "pagination.html" $paginator }} + +{{- end }} {{ end }}