pages/_includes/responsive_img.html
Maruan Al-Shedivat 8de1ad4dee Fix a small bug in _includes/responsive_img.html
Correctly fixes the issue mentioned in #471.
2021-11-25 20:36:47 -05:00

9 lines
483 B
HTML

{% assign largest = resized | sort: 'width' | last %}
{% capture srcset %}
{% for i in resized %}
{{ i.path | relative_url }} {{ i.width }}w,
{% endfor %}
{% endcapture %}
<img {% if class %}class="{{ class }}"{% endif %} src="{{ largest.path | relative_url }}" srcset="{{ srcset | strip_newlines }} {{ path | relative_url }} {{ original.width }}w" {% if alt %}alt="{{ alt }}"{% endif %} {% if title %}title="{{ title }}"{% endif %} {% if zoomable %}data-zoomable{% endif %}/>