neddit

the frontend of the frontpage of the internet  https://neddit.ce9e.org
git clone https://git.ce9e.org/neddit.git

commit
732a22ea275bee77b5dbb63ccf7d2e2bb3170dcd
parent
bda5b3c1188cdce1e41df21da8e6580a82658c3b
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-08-19 11:14
avoid crash on failed img

Diffstat

M templates/_post.html 6 ++++--

1 files changed, 4 insertions, 2 deletions


diff --git a/templates/_post.html b/templates/_post.html

@@ -22,8 +22,10 @@
   22    22 		{% for gallery_item in post.data.gallery_data['items'] %}
   23    23 			{% with img = post.data.media_metadata[gallery_item.media_id] %}
   24    24 				<picture>
   25    -1 					<source srcset="{% for res in img.p %}{{ res.u }} {{ res.x }}w{% if not loop.last %}, {% endif %}{% endfor %}" sizes="40em">
   26    -1 					<img class="poster" src="{{ img.p|last|attr('u') }}">
   -1    25 					{% if img.p %}
   -1    26 						<source srcset="{% for res in img.p %}{{ res.u }} {{ res.x }}w{% if not loop.last %}, {% endif %}{% endfor %}" sizes="40em">
   -1    27 						<img class="poster" src="{{ img.p|last|attr('u') }}">
   -1    28 					{% endif %}
   27    29 				</picture>
   28    30 			{% endwith %}
   29    31 		{% endfor %}