{{- $type := .Get "type" }} {{- $figID := print "fig-" .Page.File.UniqueID "-" .Ordinal }} {{- $src := .Get "src" }} {{- $alt := .Get "alt" }} {{- $var := .Get 0 }} {{- if eq $src "cover" }} {{- $src = partial "page/cover.html" (dict "page" $.Page ) }} {{- $coverAlt := or $.Page.Params.Alt $.Page.Params.coverAlt $.Page.Params.imagesAlt }} {{- if and $coverAlt (not $alt) }} {{ $alt = $coverAlt }} {{- end }} {{- end }} {{ $caption := .Get "caption" }} {{- if eq $caption "alt" }} {{ $caption = $alt }} {{- end }} {{- if not (eq $type "margin") }} {{- if eq $type "full" }}
{{- else }}
{{- end }} {{- end }} {{- if eq $type "full" }} {{- with .Get "link" }}{{ end }}  {{ . }} {{- if .Get "link" }}{{ end }}
{{- else }} {{- if eq $type "margin" }} {{- with .Get "link" }} {{- end }}  {{ . }} {{- if .Get "link" }}{{ end }} {{ else }} {{- end }} {{- end }} {{ with .Get "title" }}{{ . }} {{ end }} {{ with $caption }}{{ . }}{{ end }} {{ with .Get "attrlink" }}{{ end }} {{- with .Get "attr" }}{{ . }}{{ end }} {{- if .Get "attrlink" }}{{ end }} {{- if eq $type "full" }}
{{- else }} {{- end }} {{- if and (not (eq $type "full")) (not (eq $type "margin")) }} {{ with .Get "link" }}{{ end }} {{ . }} {{- if .Get "link" }}{{ end }} {{- end }} {{- if not (eq $type "margin") }}
{{- end }}