From a93f3de6ee3c6cb0e35efaf500d48e600486888d Mon Sep 17 00:00:00 2001
From: Dominik George <dominik.george@teckids.org>
Date: Wed, 13 Mar 2024 15:27:24 +0100
Subject: [PATCH] Auto-scale image proportionally in blog card

---
 templates/blog/card.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/templates/blog/card.html b/templates/blog/card.html
index d07f0b4d..36270d51 100644
--- a/templates/blog/card.html
+++ b/templates/blog/card.html
@@ -2,7 +2,8 @@
             <div class="card-image">
               <a href="{{ post.permalink }}">
                 <figure class="image is-4by3">
-                  <img src="{{ get_url(path="@/" ~ post.relative_path, trailing_slash=true) }}{{ post.extra.depiction.image | safe }}" alt="{{ post.extra.depiction.alt }}" />
+                  {% set image = resize_image(path="@/" ~ post.colocated_path ~ "/" ~ post.extra.depiction.image, width=800, height=600) -%}
+                  <img src="{{ image.url }}" alt="{{ post.extra.depiction.alt }}" />
                   {% if post.extra.depiction.credits %}
                     <figcaption>{{ post.extra.depiction.credits }}</figcaption>
                   {% endif %}
-- 
GitLab