newblog/templates/shortcodes/image.html

8 lines
401 B
HTML
Raw Permalink Normal View History

2024-07-01 15:20:09 +02:00
<picture>
{% for source in sources -%}
{% set type = source | split(pat=".") | last -%}
<source srcset="{{ config.base_url | safe}}{{ page.path | safe }}{{ source | safe }}" type="{{ 'img/' ~ type }}" />
{% endfor -%}
<img src="{{ fpath }}" alt="{{ falt | default(value='Image') }}"{% if fw %} width="{{fw}}"{% endif %}{% if fh %} height="{{fh}}"{% endif %} loading="lazy" />
</picture>