From 1fa35357d1491b599bb3b2fb4e833294a50eada2 Mon Sep 17 00:00:00 2001 From: Alexander Avery Date: Thu, 5 Jun 2025 11:50:11 -0400 Subject: [PATCH] fix alt tags --- layouts/_default/list.html | 6 ++++-- layouts/_default/single.html | 7 ++++--- layouts/authors/terms.html | 15 +++++++++++---- layouts/partials/article.html | 6 ++---- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index a201d40..94b68dc 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -16,12 +16,14 @@ #{{ .LinkTitle }} {{- end }} + {{- with (.Resources.GetMatch "featured") }} {{- partial "image.html" (dict - "image" (.Resources.GetMatch "featured") - "alt" .Params.featured.alt + "image" . + "alt" .Params.alt "sizes" (slice 320 480 600 800) "classes" (slice "shadow" "featured")) }} + {{- end }} {{ .Content }}
{{- range .Data.Pages }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 27a1195..fdffc0b 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -16,13 +16,14 @@ #{{ .LinkTitle }} {{- end }} + {{- with (.Resources.GetMatch "featured") }} {{- partial "image.html" (dict - "image" (.Resources.GetMatch "featured") - "alt" .Params.featured.alt + "image" . + "alt" .Params.alt "sizes" (slice 320 480 600 800) "classes" (slice "shadow" "featured")) }} - + {{- end }} {{ .Content }} {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} {{ end }} diff --git a/layouts/authors/terms.html b/layouts/authors/terms.html index f4f81a9..b1731ef 100644 --- a/layouts/authors/terms.html +++ b/layouts/authors/terms.html @@ -2,13 +2,20 @@

Authors

{{- range .Data.Pages }} + + {{- $title := .Params.name }} + {{- $summary := .Params.bio }} + + {{- with (.Resources.GetMatch "avatar") }} {{- partial "article-alt.html" (dict - "image" (.Resources.GetMatch "avatar") + "image" . "alt" .Params.alt - "title" .Params.name - "summary" .Params.bio + "title" $title + "summary" $summary "url" (printf "/%s/%s" "authors" (.Params.name | urlize))) }} + {{- end }} + {{- end }}
-{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/partials/article.html b/layouts/partials/article.html index 570371e..eac990a 100644 --- a/layouts/partials/article.html +++ b/layouts/partials/article.html @@ -1,10 +1,8 @@ -{{- $alt := .Params.featured.alt }} -{{- $img := .Resources.GetMatch "featured" }}