feat: use thumbnail in section and links image (#1291)

* feat: use thumbnail for section image

* feat: use thumbnail in links image

* fix typo
This commit is contained in:
Jimmy
2026-03-05 13:57:37 +01:00
committed by GitHub
parent a95d0e7c85
commit 25bf63778c
2 changed files with 27 additions and 12 deletions
@@ -1,5 +1,5 @@
<div class="article-list--compact links">
{{ range $i, $link := .Params.links }}
{{ range $link := .Params.links }}
<article>
<a href="{{ $link.website }}" target="_blank" rel="noopener">
<div class="article-details">
@@ -18,13 +18,19 @@
{{- $image := partial "helper/image" (dict "Image" $link.image "Resources" $.Resources) -}}
{{- with $image -}}
<div class="article-image">
<img
src="{{ .Permalink }}"
loading="lazy"
{{ with $link.alt }} alt="{{ . }}"{{ end }}
{{ with .Width }} width="{{ . }}"{{ end }}
{{ with .Height }} height="{{ . }}"{{ end }}
>
{{ partial "helper/thumbnail-image" (dict
"Resource" .Resource
"Width" 60
"Height" 60
"Resize" $.Site.Params.ImageProcessing.Thumbnail.Enabled
"Attributes" (dict
"src" $image.Permalink
"alt" $link.title
"loading" "lazy"
"width" .Width
"height" .Height
)
) }}
</div>
{{ end }}
</a>