feat: improve feature image presentation

This commit is contained in:
Friday authored and Nuno C. committed 2026-08-17 20:19:02 +01:00
1 parent 53a64328d7
commit af0e11171c
8 files changed
+49 -14

No files matched your search

+8 -3
View File
@@ -27,6 +27,9 @@
{{ $page := .Page }}
{{ $featured := "" }}
{{ $featuredURL := "" }}
{{ $featureImageHover := site.Params.list.featureImageHover | default false }}
{{ if isset .Params "featureImageHover" }}{{ $featureImageHover = .Params.featureImageHover }}{{ end }}
{{ $featureImagePosition := .Params.imagePositionFeature | default site.Params.imagePositionFeature | default site.Params.imagePosition }}
{{ if not .Params.hideFeatureImage }}
{{/* frontmatter */}}
{{ with $page }}
@@ -79,15 +82,17 @@
{{ end }}
<article class="article-link--simple {{ $cardClasses }}">
<article class="article-link--simple group {{ $cardClasses }}">
{{ with $featuredURL }}
<div class="flex-none relative overflow-hidden {{ $imgWrapperClasses }} thumbnail">
<img
src="{{ . }}"
role="presentation"
alt="{{ $page.Title }}"
loading="lazy"
decoding="async"
class="not-prose absolute inset-0 w-full h-full object-cover" />
fetchpriority="low"
class="not-prose absolute inset-0 h-full w-full object-cover transition duration-500 {{ if $featureImageHover }}group-hover:scale-105{{ end }}"
{{ with $featureImagePosition }}style="object-position: {{ . }};"{{ end }} />
</div>
{{ end }}
<div class="{{ $cardContentClasses }}">