feat: avoid regenerate color scheme when image URL is changed
Use MD5 as key to identify images, and .Slug as id
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<article class="{{ if .context.Params.image }}has-image{{ end }}">
|
||||
<a href="{{ .context.Permalink }}">
|
||||
{{ if .context.Params.image }}
|
||||
{{- $thumbnail := (partial "helper/image" (.context) ).Fill .size -}}
|
||||
{{- $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">
|
||||
loading="lazy" data-id="{{ .context.Slug }}" data-key="{{ $image.Data.Integrity }}">
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user