Add decoding async to images

This commit is contained in:
Pedro Moreno 2023-02-23 20:42:21 +01:00
parent c15a43b81a
commit d22bde5d70
8 changed files with 9 additions and 9 deletions

View file

@ -30,7 +30,7 @@
{% if image %}
<span class="image featured">
{{ image.cropZoom(1038, 437).loading('lazy').html(title, title)|raw }}
{{ image.cropZoom(1038, 437).loading('lazy').attribute('decoding','async').html(title, title)|raw }}
</span>
{% endif %}

View file

@ -19,7 +19,7 @@
</div>
{% if image %}
<span class="image object fit">
{{image.loading('lazy').html(title,title)|raw}}
{{image.loading('lazy').attribute('decoding','async').html(title,title)|raw}}
</span>
{% endif %}
</section>

View file

@ -12,7 +12,7 @@
</header>
{% if image %}
{{ image.cropZoom(1038,437).loading('lazy').html(title, title, 'image featured')|raw }}
{{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title, 'image featured')|raw }}
{% endif %}
{{ page.content|raw }}

View file

@ -16,7 +16,7 @@
{% endif %}
</header>
<a href="{{p.url}}" class="image">
{{ image.cropZoom(64,64).quality(60).loading('lazy').html(title,title)|raw }}
{{ image.cropZoom(64,64).quality(60).loading('lazy').attribute('decoding','async').html(title,title)|raw }}
</a>
</article>
</li>

View file

@ -47,7 +47,7 @@
</header>
{% if image %}
<a class="image featured" href="{{ page.url }}" title="{{ title|raw }}">
{{ image.cropZoom(1038,437).loading('lazy').html(title, title)|raw }}
{{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title)|raw }}
</a>
{% endif %}
<div itemprop="articleBody">

View file

@ -38,7 +38,7 @@
</header>
{% if image %}
<a href="{{ p.url }}" class="image">
{{ image.cropZoom(1038,437).loading('lazy').html(title,title)|raw}}
{{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title,title)|raw}}
</a>
{% endif %}
</article>

View file

@ -5,7 +5,7 @@
{% if thumb %}
<div class="search-image">
<a href="{{ page.url }}">{{ thumb.loading('lazy').html(title,title)|raw }}</a>
<a href="{{ page.url }}">{{ thumb.loading('lazy').attribute('decoding','async').html(title,title)|raw }}</a>
</div>
{% endif %}
<div class="search-item">

View file

@ -40,7 +40,7 @@
</header>
{% if image %}
<span class="image featured">
{{ image.cropZoom(1038,437).loading('lazy').html(title, title)|raw }}
{{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title)|raw }}
</span>
{% endif %}
@ -54,7 +54,7 @@
{% set item_image = page.media[item.image] %}
{% set item_title = item.title %}
{% set item_desc = item.description %}
{% set thumbnail = item_image.cropZoom(thumb_w, thumb_h).attribute('itemprop','http://schema.org/image').html(item_title,item_title) %}
{% set thumbnail = item_image.cropZoom(thumb_w, thumb_h).loading('lazy').attribute('decoding','async').attribute('itemprop','http://schema.org/image').html(item_title,item_title) %}
<div class="{{columns}} portfolio_item">
<a href="{{item_image.url}}" class="glightbox"data-height="{{page.header.height}}" data-width="{{page.header.width}}" data-title="{{item_title}}" data-description="{{item_desc|raw}}" data-desc-position="{{item.descPosition}}" data-zoomable="{{page.header.zoomable}}" data-draggable="{{page.header.draggable}}" data-type="image">
<span class="image fit">