From b5b50cdefbf1864778fbb5bbb3a83869811b39ac Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 16 Apr 2023 18:06:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20handle=20missing=20image?= =?UTF-8?q?=20metadata=20gracefully?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/macros/cards_pages.html | 2 +- templates/shortcodes/dimmable_image.html | 2 +- templates/shortcodes/dual_theme_image.html | 4 ++-- templates/shortcodes/invertible_image.html | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/macros/cards_pages.html b/templates/macros/cards_pages.html index bb37cc1..4d73a89 100644 --- a/templates/macros/cards_pages.html +++ b/templates/macros/cards_pages.html @@ -7,7 +7,7 @@ {% endif %} {% if page.extra.local_image %} - {% set meta = get_image_metadata(path=page.extra.local_image) %} + {% set meta = get_image_metadata(path=page.extra.local_image, allow_missing=true) %} {{ {% elif page.extra.remote_image %} {{ diff --git a/templates/shortcodes/dimmable_image.html b/templates/shortcodes/dimmable_image.html index 05304f9..9e61ab5 100644 --- a/templates/shortcodes/dimmable_image.html +++ b/templates/shortcodes/dimmable_image.html @@ -1,2 +1,2 @@ -{% set meta = get_image_metadata(path=src) %} +{% set meta = get_image_metadata(path=src, allow_missing=true) %} diff --git a/templates/shortcodes/dual_theme_image.html b/templates/shortcodes/dual_theme_image.html index d97ea2a..fa24dec 100644 --- a/templates/shortcodes/dual_theme_image.html +++ b/templates/shortcodes/dual_theme_image.html @@ -1,4 +1,4 @@ -{% set light_meta = get_image_metadata(path=light_src) %} -{% set dark_meta = get_image_metadata(path=dark_src) %} +{% set light_meta = get_image_metadata(path=light_src, allow_missing=true) %} +{% set dark_meta = get_image_metadata(path=dark_src, allow_missing=true) %} diff --git a/templates/shortcodes/invertible_image.html b/templates/shortcodes/invertible_image.html index 25d3c66..8a7e20a 100644 --- a/templates/shortcodes/invertible_image.html +++ b/templates/shortcodes/invertible_image.html @@ -1,2 +1,2 @@ -{% set meta = get_image_metadata(path=src) %} +{% set meta = get_image_metadata(path=src, allow_missing=true) %}