diff options
author | tdro <tdro@noreply.example.com> | 2023-11-07 07:21:18 -0500 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-11-07 07:21:18 -0500 |
commit | b2c5f2b8cabb6b20a426d2e9c1d5ae7157a3c354 (patch) | |
tree | c778aef2ce108f7f2c7d933ec39696dde9177fdd /themes/default/layouts/partials | |
parent | 72f3e6e848f0a965118b0b9cab894bb5b862c29b (diff) | |
download | canory-b2c5f2b8cabb6b20a426d2e9c1d5ae7157a3c354.tar.gz canory-b2c5f2b8cabb6b20a426d2e9c1d5ae7157a3c354.tar.bz2 canory-b2c5f2b8cabb6b20a426d2e9c1d5ae7157a3c354.zip |
themes/default/layouts/_default/_markup/render-image: Guard cases
To satisfy the validator and fix last deployment
Diffstat (limited to 'themes/default/layouts/partials')
-rw-r--r-- | themes/default/layouts/partials/gallery-walk.html | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/themes/default/layouts/partials/gallery-walk.html b/themes/default/layouts/partials/gallery-walk.html index 693c113..ca95d3f 100644 --- a/themes/default/layouts/partials/gallery-walk.html +++ b/themes/default/layouts/partials/gallery-walk.html @@ -26,16 +26,20 @@ {{- range $image := $data }} <a href="{{ $image.relatedHref }}"> <picture> - <source - {{ $image.srcset | safeHTMLAttr }} - {{ $image.type | safeHTMLAttr }} - /> + {{- with $image.srcset -}} + <source + {{ $image.srcset | safeHTMLAttr }} + {{ $image.type | safeHTMLAttr }} + /> + {{- end -}} <img loading="lazy" {{ $image.alt | safeHTMLAttr }} {{ $image.title | safeHTMLAttr }} + {{ with ne (index (last 1 (split $image.width "=")) 0) `""` }} {{ $image.width | safeHTMLAttr }} {{ $image.height | safeHTMLAttr }} + {{ end }} {{ $image.src | safeHTMLAttr }} {{ $image.style | safeHTMLAttr }} /> |