{{- $dest := .Destination -}} {{- $alt := .Text -}} {{- $class := "md-image-responsive" -}} {{- with .Title }}{{ $class = printf "md-image-responsive %s" . }}{{ end -}} {{- $img := "" -}} {{- $ext := lower (path.Ext $dest) -}} {{- if and (in (slice ".png" ".jpg" ".jpeg") $ext) (not (urls.Parse $dest).Scheme) (not (hasPrefix $dest "//")) -}} {{- $rel := $dest -}} {{- if not (hasPrefix $dest "/") -}} {{- with .Page.File -}} {{- $rel = path.Join (replace .Dir "\\" "/") $dest -}} {{- end -}} {{- end -}} {{- $img = resources.Get (path.Join "contentimg" $rel) -}} {{- if not $img -}}{{- $img = resources.Get $rel -}}{{- end -}} {{- end -}}
{{- with $img }} {{- $webp := .Process "webp q85" }} {{ $alt }} {{- else }} {{ $alt }} {{- end }}