fix(article list): specify image width in srcset

This commit is contained in:
Jimmy Cai 2020-09-14 13:37:50 +02:00
parent 8c4ad17a09
commit 1e28a661d9
No known key found for this signature in database
GPG key ID: 3EA408E527F37B18

View file

@ -8,7 +8,7 @@
{{- $thumbnailRetina := $image.resource.Fill "1600x500" -}}
<img src="{{ $thumbnail.RelPermalink }}"
srcset="{{ $thumbnail.RelPermalink }} 1x, {{ $thumbnailRetina.RelPermalink }} 2x"
srcset="{{ $thumbnail.RelPermalink }} 800w, {{ $thumbnailRetina.RelPermalink }} 1600w"
width="{{ $thumbnail.Width }}" height="{{ $thumbnail.Height }}" loading="lazy"
alt="Featured image of post {{ .Title }}" />
{{ else }}