32732d4bf1
Use MD5 as key to identify images, and .Slug as id
18 lines
740 B
HTML
18 lines
740 B
HTML
<article class="{{ if .context.Params.image }}has-image{{ end }}">
|
|
<a href="{{ .context.Permalink }}">
|
|
{{ if .context.Params.image }}
|
|
{{- $image := partial "helper/image" .context | resources.Fingerprint "md5" -}}
|
|
{{- $thumbnail := $image.Fill .size -}}
|
|
<div class="article-image">
|
|
<img src="{{ $thumbnail.RelPermalink }}" width="{{ $thumbnail.Width }}" height="{{ $thumbnail.Height }}"
|
|
loading="lazy" data-id="{{ .context.Slug }}" data-key="{{ $image.Data.Integrity }}">
|
|
</div>
|
|
{{ end }}
|
|
|
|
<div class="article-details">
|
|
<h2 class="article-title">
|
|
{{- .context.Title -}}
|
|
</h2>
|
|
</div>
|
|
</a>
|
|
</article> |