From 46e7e5e4cd469010f77b5b2087a528d0cff0829f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sun, 7 Apr 2024 13:45:16 +0200 Subject: [PATCH] image: unify #824 --- layouts/partials/shortcodes/image.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/partials/shortcodes/image.html b/layouts/partials/shortcodes/image.html index 8612901418..253486336a 100644 --- a/layouts/partials/shortcodes/image.html +++ b/layouts/partials/shortcodes/image.html @@ -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 }}