image: unify #824

This commit is contained in:
Sören Weber 2024-04-07 13:45:16 +02:00
parent 86b53ec26c
commit 46e7e5e4cd
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -15,6 +15,7 @@
{{- end }}
{{- $height := "auto" }}
{{- $width := "auto" }}
{{- $attributes := .attributes | default dict }}
{{- $dest_url := urls.Parse $url }}
{{- $dest_path := $dest_url.Path }}
{{- $image := "" }}
@ -76,7 +77,7 @@
{{- $classes = $classes | append $c }}
{{- end }}
{{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo" $page) .id }}
{{- $attributes := merge .attributes (dict "alt" $alt "src" $url "title" $title) }}
{{- $attributes = merge $attributes (dict "alt" $alt "src" $url "title" $title) }}
{{- if $effects.lazy }}
{{- $attributes = merge $attributes (dict "loading" "lazy") }}
{{- end }}