File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 33{% block content %}
44 <div >
55 {% if post .thumbnail %}
6- <img
7- src =" {{ post .thumbnail .src | resize(960 ) }}"
8- {% if post .thumbnail .alt and post .thumbnail .alt | length > 0 %}
9- alt =" {{ post .thumbnail .alt }}"
10- {% endif %}
11- />
6+ {% set largest_image = post .thumbnail .src (' large' ) %}
7+ <picture >
8+ {% for image_size in post .thumbnail .sizes | sort((a , b ) => a .width <=> b .width )| keys %}
9+ {% set largest_image = post .thumbnail .src (image_size ) %}
10+ <source srcset =" {{ post .thumbnail .src (image_size ) }}" media =" (max-width: {{ post .thumbnail .sizes [image_size ]['width' ] }}px)" >
11+ {% endfor %}
12+ <img
13+ src =" {{ largest_image }}"
14+ {% if post .thumbnail .alt and post .thumbnail .alt | length > 0 %}
15+ alt =" {{ post .thumbnail .alt }}"
16+ {% else %}
17+ alt =" "
18+ {% endif %}
19+ >
20+ </picture >
1221 {% endif %}
1322 {{ post .content }}
1423 {# Loads comments.php by default #}
Original file line number Diff line number Diff line change 55 class =" post-preview__featured-image"
66 {% if post .thumbnail .alt and post .thumbnail .alt | length > 0 %}
77 alt =" {{ post .thumbnail .alt }}"
8+ {% else %}
9+ alt =" "
810 {% endif %}
911 />
1012 {% endif %}
You can’t perform that action at this time.
0 commit comments