Skip to content

Commit

Permalink
use original image as backup for srcset
Browse files Browse the repository at this point in the history
  • Loading branch information
stereobooster committed Nov 26, 2023
1 parent b592a81 commit 06195bc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions layouts/partials/picture.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,17 @@
{{- (.Resize "660x webp").RelPermalink }} 660w
{{ if gt .Width 1024 }}
,{{ (.Resize "1024x webp").RelPermalink }} 1024w
{{ else }}
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
,{{ .RelPermalink }} {{ .Width }}w
{{ end }}
{{ end }}
{{ if gt .Width 1320 }}
,{{ (.Resize "1320x webp").RelPermalink }} 2x
{{ else }}
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
,{{ .RelPermalink }} {{ .Width }}w
{{ end }}
{{ end }}"
src="{{ (.Resize "660x webp").RelPermalink }}"
{{ end }}
Expand All @@ -81,9 +89,13 @@
{{- (.Resize "660x").RelPermalink }} 660w
{{ if gt .Width 1024 }}
,{{ (.Resize "1024x").RelPermalink }} 1024w
{{ else }}
,{{ .RelPermalink }} {{ .Width }}w
{{ end }}
{{ if gt .Width 1320 }}
,{{ (.Resize "1320x").RelPermalink }} 2x
{{ else }}
,{{ .RelPermalink }} {{ .Width }}w
{{ end }}"
src="{{ (.Resize "660x").RelPermalink }}"
{{ end }}
Expand Down

0 comments on commit 06195bc

Please sign in to comment.