From e2732d1daade2b420b9c49a252000bd4fd4f8cae Mon Sep 17 00:00:00 2001 From: Will Faught Date: Sat, 8 Apr 2023 16:02:24 -0700 Subject: [PATCH] Add image shortcode params class, fetchpriority, loading --- layouts/shortcodes/paige/image.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/paige/image.html b/layouts/shortcodes/paige/image.html index d00003bf..5305664c 100644 --- a/layouts/shortcodes/paige/image.html +++ b/layouts/shortcodes/paige/image.html @@ -1,8 +1,11 @@ {{ $alt := .Get "alt" }} {{ $breakpoints := .Get "breakpoints" }} +{{ $class := .Get "class" }} {{ $densities := .Get "densities" }} +{{ $fetchpriority := .Get "fetchpriority" }} {{ $height := .Get "height" }} {{ $link := .Get "link" }} +{{ $loading := .Get "loading" }} {{ $maxheight := .Get "maxheight" }} {{ $maxwidth := .Get "maxwidth" }} {{ $process := .Get "process" }} @@ -16,12 +19,23 @@ {{ errorf "paige/image: no content" }} {{ end }} +{{ if $class }} + {{ $class = split $class " " }} +{{ else }} + {{ $class = slice }} +{{ end }} + +{{ $class = $class | append "img-fluid" | uniq | sort }} +{{ $class = delimit $class " " }} + {{ $content := partial "paige/img.html" (dict "alt" $alt "breakpoints" $breakpoints - "class" "img-fluid" + "class" $class "densities" $densities + "fetchpriority" $fetchpriority "height" $height + "loading" $loading "maxheight" $maxheight "maxwidth" $maxwidth "process" $process