diff --git a/layouts/partials/shortcodes/image.html b/layouts/partials/shortcodes/image.html index fc7ede7440..49d8421769 100644 --- a/layouts/partials/shortcodes/image.html +++ b/layouts/partials/shortcodes/image.html @@ -2,7 +2,7 @@ {{- $url := .url }} {{- $title := .title }} {{- $alt := .alt }} -{{- $classes := "" }} +{{- $classes := slice }} {{- $featherlight := true }} {{- $height := "auto" }} {{- $width := "auto" }} @@ -22,7 +22,9 @@ {{- end }} {{- end }} {{- if $dest_url.RawQuery }} - {{- $classes = (replaceRE "\\s+" " " (replaceRE "," " " ($dest_url.Query.Get "classes") ) ) }} + {{- if $dest_url.Query.Get "classes" }} + {{- $classes = $classes | append (split ($dest_url.Query.Get "classes") ",") }} + {{- end }} {{- $featherlight = (ne ($dest_url.Query.Get "featherlight") "false") }} {{- with $dest_url.Query.Get "height" }} {{ $height = . }} @@ -34,7 +36,7 @@ {{- if $featherlight }} {{- end }} -{{ $alt }} +{{ $alt }} {{- if $featherlight }} {{- end }} \ No newline at end of file