{{ if .Get "src" }} {{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) }} {{ if .Get "fit"}} {{ .Scratch.Set "image" ($original.Fit (.Get "fit")) }} {{ else if .Get "resize"}} {{ .Scratch.Set "image" ($original.Resize (.Get "resize")) }} {{ else if .Get "fill"}} {{ .Scratch.Set "image" ($original.Fill (.Get "fill")) }} {{ else }} {{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize."}} {{ end }} {{ $image := .Scratch.Get "image" }}
{{ with .Get "link"}} {{ end }} {{ . | plainify }} {{ with .Get "link"}} {{ end }} {{ if .Get "caption" }}
{{ .Get "caption" | safeHTML }}
{{ end }}
{{ end }}