use original image as backup for srcset

pull/693/head
stereobooster 2023-11-26 02:02:09 +01:00
parent 3ffe2b1002
commit 8cfe33965b
1 changed files with 12 additions and 0 deletions

View File

@ -57,9 +57,17 @@
{{- (.Resize "660x webp").RelPermalink }} 660w {{- (.Resize "660x webp").RelPermalink }} 660w
{{ if gt .Width 1024 }} {{ if gt .Width 1024 }}
,{{ (.Resize "1024x webp").RelPermalink }} 1024w ,{{ (.Resize "1024x webp").RelPermalink }} 1024w
{{ else }}
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
,{{ .RelPermalink }} {{ .Width }}w
{{ end }}
{{ end }} {{ end }}
{{ if gt .Width 1320 }} {{ if gt .Width 1320 }}
,{{ (.Resize "1320x webp").RelPermalink }} 2x ,{{ (.Resize "1320x webp").RelPermalink }} 2x
{{ else }}
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
,{{ .RelPermalink }} {{ .Width }}w
{{ end }}
{{ end }}" {{ end }}"
src="{{ (.Resize "660x webp").RelPermalink }}" src="{{ (.Resize "660x webp").RelPermalink }}"
{{ end }} {{ end }}
@ -81,9 +89,13 @@
{{- (.Resize "660x").RelPermalink }} 660w {{- (.Resize "660x").RelPermalink }} 660w
{{ if gt .Width 1024 }} {{ if gt .Width 1024 }}
,{{ (.Resize "1024x").RelPermalink }} 1024w ,{{ (.Resize "1024x").RelPermalink }} 1024w
{{ else }}
,{{ .RelPermalink }} {{ .Width }}w
{{ end }} {{ end }}
{{ if gt .Width 1320 }} {{ if gt .Width 1320 }}
,{{ (.Resize "1320x").RelPermalink }} 2x ,{{ (.Resize "1320x").RelPermalink }} 2x
{{ else }}
,{{ .RelPermalink }} {{ .Width }}w
{{ end }}" {{ end }}"
src="{{ (.Resize "660x").RelPermalink }}" src="{{ (.Resize "660x").RelPermalink }}"
{{ end }} {{ end }}