diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 518f81b..b357b27 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -41,6 +41,9 @@ {{ $src = $image.RelPermalink -}} {{ $width = $image.Width -}} {{ $height = $image.Height -}} + {{ if $srcset -}} + {{ $srcsetw = $srcsetw | append (printf "%s %sw" $src (strings.TrimRight "x" $size)) }} + {{ end -}} {{ else -}} {{ $src = $resource.RelPermalink -}} {{ $realwidth = $resource.Width -}} diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 2cb3fc9..ebe47d2 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -37,6 +37,9 @@ {{ $src = $image.RelPermalink -}} {{ $width = $image.Width -}} {{ $height = $image.Height -}} + {{ if $srcset -}} + {{ $srcsetw = $srcsetw | append (printf "%s %sw" $src (strings.TrimRight "x" $size)) }} + {{ end -}} {{ else -}} {{ $src = $resource.RelPermalink -}} {{ $realwidth = $resource.Width -}}