{{- if .Get "link" -}}
{{- end -}}
{{- if eq (.Get "raw") true }}
{{- $img := resources.Get (.Get "src") }}
{{- else }}
{{- partial "image.html" (dict "path" (.Get "src") "alt" (or (.Get "alt") (or (.Get "caption" | markdownify | plainify) (.Get "title"))) "width" (.Get "width") "height" (.Get "height")) }}
{{- end }}
{{- if .Get "link" }}{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
{{- with .Get "title" -}}
{{ . }}
{{- end }}
{{- if and (.Get "title") (.Get "caption") }}
{{" - "}}
{{- end }}
{{- with .Get "caption" }}
{{- . | markdownify -}}
{{- end -}}
{{- if .Get "attr" }}
{{- if or (.Get "title") (.Get "caption") }}
{{" - "}}
{{- end }}
{{- with .Get "attrlink" }}
{{- end -}}
{{- .Get "attr" | markdownify -}}
{{- if .Get "attrlink" }}{{ end }}
{{- end -}}
{{- end }}