<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
    {{ $img_path := print "/static" (.Get "src") }}
    {{- if not (fileExists $img_path ) -}}
      {{ errorf "Image missing %q in %s" $img_path .Position }}
    {{- end -}}
    {{- if .Get "link" -}}
        <a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
    {{- end -}}
    <img src="{{ .Get "src" }}"
         {{- if or (.Get "alt") (.Get "caption") }}
         alt="{{ with 