summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-01-02 10:26:00 +0800
committerEltrac <hi@guhub.cn>2025-01-02 10:26:00 +0800
commit9b46de1f32e572c22dc133da67c22a4290d33ff8 (patch)
tree04bb8498b75d89def83b7413363f38e62fe8593f
parent663759ed38d3d167a96ce19d9f70bcb2978f4253 (diff)
perf: show blurry thumbnail image before lazy loading
-rw-r--r--layouts/shortcodes/img.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html
index b33e661d..cb2d2571 100644
--- a/layouts/shortcodes/img.html
+++ b/layouts/shortcodes/img.html
@@ -2,7 +2,7 @@
<figure {{ with .Get "class" }}class="{{ . }}"{{ end }}>
{{ with .Get "link" }}<a href="{{ . }}">{{ end }}
<a href="{{ .Get "src" }}" data-fancybox {{ if isset .Params "title" }} data-caption="{{.Get "title" }}" {{ end }}>
- <img class="lazy" data-src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" }}{{ end }}"{{ end }} />
+ <img class="lazy" data-src="{{ .Get "src" }}" src="{{ .Get "src" }}!thumbnail" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" }}{{ end }}"{{ end }} />
</a>
{{ if .Get "link" }}</a>{{ end }}
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr") }}