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 }}