From b06050e420217d562d8a9f234d89bf55dd2d39bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Fri, 16 Dec 2022 21:34:07 +0100 Subject: [PATCH] image: prepare for classes as parameters as like in link #419 --- layouts/partials/shortcodes/image.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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