mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-07-23 02:18:57 +00:00
Show image only if there is one
This commit is contained in:
parent
c271f52d5b
commit
1722758ab6
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
{% if page.header.primaryImage %}
|
{% 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>
|
<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>
|
<a href="{{ page.url }}">{{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue