Show image only if there is one

This commit is contained in:
pikim 2023-01-19 22:00:00 +01:00
parent c271f52d5b
commit 1722758ab6

View file

@ -42,7 +42,7 @@
{% if page.header.primaryImage %}
<a href="{{ page.url }}">{{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}</a>
{% else %}
{% elseif page.media.images %}
<a href="{{ page.url }}">{{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}</a>
{% endif %}