diff --git a/themes/openpowerfoundation/layouts/shortcodes/image.html b/themes/openpowerfoundation/layouts/shortcodes/image.html new file mode 100644 index 0000000..4225d9e --- /dev/null +++ b/themes/openpowerfoundation/layouts/shortcodes/image.html @@ -0,0 +1,15 @@ +{{ $src := .Get "src" }} +{{ $imagesrc := (printf "images/%s" $src) }} +{{ $width := .Get "width" }} +{{ $height := .Get "height" }} +{{ $imageresource := resources.Get $imagesrc }} +{{ if eq $width "" }} + {{ $width = "500" }} +{{ end }} +{{ if eq $height "" }} + {{ $height = "500" }} +{{ end }} +{{ $imageprocessing := (printf "%sx%s %s" $width $height "webp") }} +{{ $image := $imageresource.Fit $imageprocessing }} + +