From 200bf8fdc8814f6ddad594fcc2e19f35835cd802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 4 Nov 2023 20:25:27 +0100 Subject: [PATCH] display Bevy logo if an image is missing (#804) --- templates/macros/images.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/macros/images.html b/templates/macros/images.html index a8dae966fc..4f04333806 100644 --- a/templates/macros/images.html +++ b/templates/macros/images.html @@ -2,7 +2,12 @@ {%- if path is ending_with(".svg") or path is ending_with(".gif") or path is ending_with(".webp") -%} {{- get_url(path=path) -}} {%- else -%} - {%- set image = resize_image(path=path, width=width, height=height, op="fit") -%} - {{- image.url -}} + {% set metadata = get_image_metadata(path=path, allow_missing=true) %} + {% if metadata %} + {%- set image = resize_image(path=path, width=width, height=height, op="fit") -%} + {{- image.url -}} + {% else %} + assets/bevy_icon_dark.svg + {% endif %} {%- endif -%} {%- endmacro card %}