{# Django template for Image #} {% load components %} {% if srcSet %}{% asset_srcset srcSet staticBaseUrl as imageSrcSet %}{% endif %} {# Props: src, alt, href, rounded, circular, objectFit, maxWidth, maxHeight, caption, hideCaption, className #} {# For responsive images, src may be an object: { fallback, sources: [{ srcSet, media?, type?, sizes? }] } #} {% comment %} Build shared values {% endcomment %} {% with classes="usx-image"|add:" usx-image--rounded"|yesno:","|slice:"0" %} {% endwith %} {% comment %} Inline image element (string src or picture) {% endcomment %} {% with img_style=""|add:"" %} {% endwith %} {% if caption %}
{% if src.fallback %} {% for source in src.sources %} {% endfor %} {% elif src %} {% else %} Image {% endif %}
{{ caption }}
{% else %} {% if href %} {% if src.fallback %} {% for source in src.sources %} {% endfor %} {% elif src %} {% else %} Image {% endif %} {% if href %}{% else %}{% endif %} {% endif %}