From cce809cd2622e628a70a9007171b11a5e8b51484 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Sun, 21 Jan 2024 21:13:44 +1300 Subject: [PATCH] masonry - thumbnail width and height to reduce page layout shifts from lazy images --- app/templates/post/_post_teaser_masonry.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/templates/post/_post_teaser_masonry.html b/app/templates/post/_post_teaser_masonry.html index 10016f91..e0815cd8 100644 --- a/app/templates/post/_post_teaser_masonry.html +++ b/app/templates/post/_post_teaser_masonry.html @@ -13,18 +13,18 @@
{% if post.type == POST_TYPE_LINK %} {% if post.image.thumbnail_url() %} - {{ post.image.alt_text if post.image.alt_text else '' }} + {{ post.image.alt_text if post.image.alt_text else '' }} {% elif post.image.source_url %} - {{ post.title }} {% else %} - {{ post.title }} {% endif %} {% elif post.type == POST_TYPE_IMAGE %} {{ post.image.alt_text if post.image.alt_text else '' }} + alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" width="{{ post.image.thumbnail_width }}" height="{{ post.image.thumbnail_height }}" /> {% else %} {{ post.image.alt_text if post.image.alt_text else '' }}