clean up code and add lazy-loading

This commit is contained in:
Fliegerjohn 2025-01-13 14:25:13 +01:00
parent 6d688ae205
commit 1c5631d82c
Signed by: fliegerjohn
GPG key ID: E2221D5FE4656B6A

View file

@ -1,11 +1,3 @@
{{ if .Title }}
<figure>
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
<figcaption>{{ .Title }}</figcaption>
</figure>
{{ else }}
<figure>
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
</figure>
{{ end }}
{{ $img := imageConfig (add "/static/" (.Destination | safeURL)) }}
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" loading="lazy"/>