Something went wrong. Try again.
Source code of my website codeka.io
Something went wrong. Try again.
1234567891011121314151617181920{{- $image := .Page.Resources.GetMatch .Destination -}}
{{- $width820 := math.Min 820 $image.Width -}}{{- $resizeOpts := printf "%dx webp q75 lanczos" (int $width820) -}}{{- $img820 := $image.Resize $resizeOpts -}}
{{- $width480 := math.Min 480 $image.Width -}}{{- $resizeOpts := printf "%dx webp q75 lanczos" (int $width480) -}}{{- $img480 := $image.Resize $resizeOpts -}}
<img srcset=" {{ $img820.RelPermalink }} 820w, {{ $img480.RelPermalink }} 480w" sizes="(max-width: 480px) 480px, 820px" src="{{ $img820.RelPermalink }}" {{- with $.PlainText }} alt="{{ . }}"{{ end -}} {{ with $.Title }}title="{{ . }}"{{ end }}>{{- /* chomp trailing newline */ -}}