{{- $autolinking := .Page.Param "imageAutoLink" | default false -}} {{- $minwidth_to_link := 1000 -}} {{- $original_img := .Page.Resources.GetMatch .Destination -}} {{- if and (not $original_img) .Page.File -}} {{- $path := path.Join .Page.File.Dir .Destination -}} {{- $original_img = resources.Get $path -}} {{- end -}} {{- with $original_img -}} {{- $image_webp_360 := "" -}} {{- $image_webp_500 := "" -}} {{- $image_webp_816 := "" -}} {{- $image_webp_1632 := "" -}} {{- if ge $original_img.Width 816 -}} {{- $image_webp_360 = $original_img.Resize "360x webp" -}} {{- $image_webp_500 = $original_img.Resize "500x webp" -}} {{- $image_webp_816 = $original_img.Resize "816x webp" -}} {{- if gt $original_img.Width 1632 -}} {{- $image_webp_1632 = $original_img.Resize "1632x webp" -}} {{- end -}} {{- else -}} {{- end -}} {{- else -}} {{- end -}}