2026-03-05 17:58:40 +01:00
|
|
|
{{ $image := partial "helper/image" (dict "Image" .context.Params.image "Resources" .context.Resources "Context" .context) }}
|
2026-01-25 23:29:41 +01:00
|
|
|
<article class="{{ if $image }}has-image{{ end }}">
|
2020-10-31 23:24:58 +01:00
|
|
|
<a href="{{ .context.RelPermalink }}">
|
2026-01-25 23:29:41 +01:00
|
|
|
{{ if $image }}
|
|
|
|
|
<div class="article-image">
|
2026-03-04 23:32:33 +01:00
|
|
|
{{ partial "helper/thumbnail-image" (dict
|
|
|
|
|
"Resource" $image.Resource
|
|
|
|
|
"Width" 250
|
|
|
|
|
"Height" 150
|
|
|
|
|
"Resize" .context.Site.Params.ImageProcessing.Thumbnail.Enabled
|
|
|
|
|
"Attributes" (dict
|
|
|
|
|
"src" $image.Permalink
|
|
|
|
|
"alt" (printf "Featured image of post %s" .context.Title)
|
|
|
|
|
"loading" "lazy"
|
|
|
|
|
"width" $image.Width
|
|
|
|
|
"height" $image.Height
|
|
|
|
|
)
|
|
|
|
|
) }}
|
2026-01-25 23:29:41 +01:00
|
|
|
</div>
|
2020-08-22 13:20:08 +02:00
|
|
|
{{ end }}
|
|
|
|
|
|
2026-01-25 23:42:28 +01:00
|
|
|
<div class="article-details"
|
2026-03-04 13:05:17 +01:00
|
|
|
{{- if and $image (reflect.IsImageResourceProcessable $image.Resource) -}}
|
2026-01-25 23:42:28 +01:00
|
|
|
{{- $colors := $image.Resource.Colors -}}
|
|
|
|
|
{{- if $colors -}}
|
|
|
|
|
{{- $vibrant := index $colors 0 -}}
|
|
|
|
|
{{- $darkMuted := index $colors 1 | default $vibrant -}}
|
|
|
|
|
style="background: linear-gradient(0deg, {{ $darkMuted }}80 0%, {{ $vibrant }}C0 100%);"
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
>
|
2020-08-22 13:20:08 +02:00
|
|
|
<h2 class="article-title">
|
|
|
|
|
{{- .context.Title -}}
|
|
|
|
|
</h2>
|
|
|
|
|
</div>
|
|
|
|
|
</a>
|
2026-01-25 23:29:41 +01:00
|
|
|
</article>
|