image: only lazy load if reference #1019

This commit is contained in:
Sören Weber 2025-02-18 00:01:51 +01:00
parent cf1fb446dd
commit a8dfe51e9d
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 2 additions and 2 deletions

View file

@ -71,9 +71,9 @@
{{- $attributes = merge $attributes (dict "src" $src) }}
{{- else }}
{{- $attributes = merge $attributes (dict "src" .url) }}
{{- if $effects.lazy }}{{ $attributes = merge $attributes (dict "loading" "lazy") }}{{ end }}
{{- end }}
{{- if $attributes.class }}{{ $classes = $classes | append (split $attributes.class " ") }}{{ end }}
{{- $attributes = merge $attributes (dict "class" (delimit $classes " ")) }}
{{- $attributes = merge $attributes (dict "style" (printf " height: %s; width: %s;%s" $height $width (index $attributes "style" | default ""))) }}
{{- if $effects.lazy }}{{ $attributes = merge $attributes (dict "loading" "lazy") }}{{ end }}
{{- return $attributes }}

View file

@ -1 +1 @@
7.3.2+a9cc5c74d60c6f4467a9e710ce73eca13235eb12
7.3.2+cf1fb446dd456655648d0ec2ccc8ae88c56e98d7