<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
  {{- with .Get "link" -}}
    <a href="{{ . }}"
      {{ with $.Get "target" }}target="{{ . }}"{{ end -}}
      {{ with $.Get "rel" }}rel="{{ . }}"{{ end -}}
    >
  {{- end -}}

  {{- $u := urls.Parse (.Get "src") -}}
  {{- $src := $u.String -}}
  {{- /* HACK: detect image size if it's a resource */ -}}
  {{- $width := 0 -}}
  {{- $height := 0 -}}
  {{- if not $u.IsAbs -}}
    {{- with or (.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}}
   