{{- $imageURL := .Get 0 -}} {{- $title := .Get 2 | default "" -}} {{- $description := .Get 3 | default "" -}} {{- $attribution := .Get 4 | default "" -}} {{- $remoteURL := printf "%s?raw=true" $imageURL -}} {{- $remoteImage := resources.GetRemote $remoteURL -}} {{- $hash := md5 $remoteURL -}} {{- $extension := path.Ext $remoteURL -}} {{- $cleanFilename := printf "%s%s" $hash $extension | replace "?raw=true" "" -}} {{- $localImage := $remoteImage | resources.Copy (printf "remote-images/%s" $cleanFilename) -}} {{- $resizedImage := $localImage.Resize "1024x" -}} {{- $hasMeta := or $title (or $description $attribution) -}}
{{ $title }} {{- if $hasMeta -}}
{{- with $title -}}

{{ . | markdownify }}

{{- end -}} {{- with $description -}}

{{ . | markdownify }}

{{- end -}}
{{- with $attribution -}}

Attribution : {{ . | markdownify }}

{{- end -}}
{{- end -}}