{{- if .image }} {{- $id := .image -}} {{- if isset .image "id" -}} {{- $id = .image.id -}} {{- end -}} {{- $image := partial "GetMedia" $id -}} {{- if $image -}} {{- $url := $image.url -}} {{- if site.Params.keycdn -}} {{- $url = $image.direct_url -}} {{- end -}} {{- $lazy := default true .lazy -}} {{- $alt := or .alt "" -}} {{- if isset .image "alt" -}} {{- $alt = .image.alt -}} {{- end -}} {{- $width := $image.width -}} {{- $height := $image.height -}} {{- $default := "1280x720" -}} {{- if .desktop -}} {{- $default = .desktop -}} {{- end -}} {{- $crop := false -}} {{- if .crop -}} {{- $crop = true -}} {{- end -}} {{ $desktop := .desktop }} {{ $tablet := .tablet }} {{ $mobile := .mobile }} {{- if .sizes -}} {{ $desktop = .sizes.desktop }} {{ $tablet = .sizes.tablet }} {{ $mobile = .sizes.mobile }} {{- end -}} {{ $is_svg := strings.HasSuffix $image.name "svg" }} {{- if strings.HasSuffix $image.name "svg" -}} {{ chomp (plainify $alt) }} {{- else -}} {{ with $desktop -}} {{- end }} {{ with $tablet -}} {{- end }} {{ with $mobile -}} {{- end }} {{ with $desktop -}} {{- end }} {{ with $tablet -}} {{- end }} {{ with $mobile -}} {{- end }} {{ chomp (plainify $alt) }} {{- end -}} {{- end -}} {{- end -}}