{{ if .Get "name" }} {{ $original := .Page.Resources.GetMatch (printf "%s*" (.Get "name") ) }} {{ if $original }} {{ $command := .Get "command" }} {{ $options := .Get "options" }} {{ if eq $command "Fit"}} {{ .Scratch.Set "image" ($original.Fit $options) }} {{ else if eq $command "Resize"}} {{ .Scratch.Set "image" ($original.Resize $options) }} {{ else if eq $command "Fill"}} {{ .Scratch.Set "image" ($original.Fill $options) }} {{ else }} {{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize."}} {{ end }} {{ end }} {{ end }} {{ $image := .Scratch.Get "image" }} {{ if or ($image) (.Get "src") }}
{{ with .Get "link"}}{{ end }} {{ . }} {{ if .Get "link"}}{{ end }} {{ with .Inner }}
{{ . | markdownify }}
{{ end }}
{{ end }}