chore: image improvements

This commit is contained in:
Cory Dransfeldt 2024-09-12 17:28:09 -07:00
parent 9c3d8e213a
commit 7dde72d1cb
No known key found for this signature in database
15 changed files with 138 additions and 164 deletions

View file

@ -15,20 +15,22 @@ schema: blog
{%- if post.image -%}
<img
srcset="
https://cdn.coryd.dev/{{ post.image }}?class=w200 200w,
https://cdn.coryd.dev/{{ post.image }}?class=w400 400w,
https://cdn.coryd.dev/{{ post.image }}?class=w800 800w,
https://cdn.coryd.dev/{{ post.image }}?class=w1600 1600w
https://cdn.coryd.dev/{{ post.image }}?class=w200&type=webp 200w,
https://cdn.coryd.dev/{{ post.image }}?class=w400&type=webp 400w,
https://cdn.coryd.dev/{{ post.image }}?class=w800&type=webp 800w,
https://cdn.coryd.dev/{{ post.image }}?class=w1600&type=webp 1600w
"
sizes="(max-width: 450px) 200px,
(max-width: 850px) 400px,
(max-width: 1000px) 800px,
1600px"
src="https://cdn.coryd.dev/{{ post.image }}?class=w1600"
1200px"
src="https://cdn.coryd.dev/{{ post.image }}?class=w200"
alt="{{ post.image_alt }}"
class="image-banner"
loading="lazy"
loading="eager"
decoding="async"
width="200"
height="auto"
/>
{%- endif -%}
{{ post.content | markdown }}