Closes #21369: Add lazy loading and decoding options for ImageAttr (#21444)

Introduces `load_lazy` and `decoding` parameters to `ImageAttr` for
enhanced image handling. Lazy loading improves page performance, while
configurable decoding options provide greater flexibility. Updates the
template to conditionally include these attributes in rendered HTML.

Fixes #21369
This commit is contained in:
Martin Hauser
2026-02-19 16:22:16 +01:00
committed by GitHub
parent fb71cafb51
commit 2c200a4fd3
2 changed files with 31 additions and 1 deletions

View File

@@ -1,3 +1,3 @@
<a href="{{ value.url }}">
<img src="{{ value.url }}" alt="{{ value.name }}" class="img-fluid" />
<img src="{{ value.url }}" alt="{{ value.name }}" class="img-fluid" {% if load_lazy %}loading="lazy" {% endif %} {% if decoding %}decoding="{{ decoding }}" {% endif %}/>
</a>