Fixed image featured classes in twig templates

This commit is contained in:
pmoreno.rodriguez 2023-02-08 15:57:40 +01:00
parent f7062ec212
commit 3a26205787
6 changed files with 23 additions and 12 deletions

View file

@ -44,8 +44,11 @@
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
{% include 'partials/breadcrumbs.html.twig' %}
{% endif %}
{% if image %}
{{ image.cropZoom(1038,437).loading('lazy').html(title, title, 'image featured')|raw }}
<span class="image featured">
{{ image.cropZoom(1038,437).loading('lazy').html(title, title)|raw }}
</span>
{% endif %}
{{ page.content|raw }}

View file

@ -18,9 +18,11 @@
{% endif %}
</div>
</header>
{% if image %}
{{ image.cropZoom(1038,437).loading('lazy').html(title, title, 'image featured')|raw }}
<span class="image featured">
{{ image.cropZoom(1038,437).loading('lazy').html(title, title)|raw }}
</span>
{% endif %}
{{ page.content|raw }}

View file

@ -27,7 +27,9 @@
</header>
{% if image %}
{{ image.cropZoom(1038,437).loading('lazy').html(title, title, 'image featured')|raw }}
<span class="image featured">
{{ image.cropZoom(1038,437).loading('lazy').html(title, title)|raw }}
</span>
{% endif %}
{{ page.content|raw}}

View file

@ -7,8 +7,10 @@
{% else %}
{% set author = page.taxonomy.author[0] %}
{% endif %}
{% set avatar = page.media[page.header.avatarImage].url|e %}
{% set image = page.media[page.header.primaryImage] ?: page.media.images|first %}
{% set title = page.title|raw %}
<header>
<div class="title">
@ -44,11 +46,11 @@
</div>
</header>
{% 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>
{% 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 %}
{% if image %}
<span class="image featured">
{{ image.cropZoom(1038,437).loading('lazy').html(title, title)|raw }}
</span>
{% endif %}
<div itemprop="articleBody">
{% if page.header.continue_link is sameas(false) %}

View file

@ -1,3 +1,3 @@
{% for item in theme_config.social %}
<li><a href="{{ item.url }}" class="icon brands {{item.icon}}"><span class="label">{{item.name}}</span></a></li>
<li><a href="{{ item.url }}" class="icon brands {{item.icon}}" aria-label="{{item.name}}"><span class="label">{{item.name}}</span></a></li>
{% endfor %}

View file

@ -21,7 +21,9 @@
</div>
</header>
{% if image %}
{{ image.cropZoom(1038,437).loading('lazy').html(title, title, 'image featured')|raw }}
<span class="image featured">
{{ image.cropZoom(1038,437).loading('lazy').html(title, title)|raw }}
</span>
{% endif %}
{{ page.content|raw}}