Default to responsive lazyloaded images

This commit is contained in:
John O'Nolan 2020-05-31 22:20:43 +07:00 committed by GitHub
parent 24e14d6c9d
commit 87afba6fc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -13,7 +13,16 @@
{{/if}}
{{#if feature_image}}
<img class="gh-feature-image" src="{{feature_image}}" alt="{{title}}" />
<img class="gh-feature-image"
srcset="{{img_url feature_image size="s"}} 300w,
{{img_url feature_image size="m"}} 600w,
{{img_url feature_image size="l"}} 1000w,
{{img_url feature_image size="xl"}} 2000w"
sizes="(max-width: 1000px) 400px, 700px"
loading="lazy"
src="{{img_url feature_image size="m"}}"
alt="{{title}}"
/>
{{/if}}
</header>
@ -50,4 +59,4 @@
</div>
</aside>
{{/post}}
{{/post}}