{{ $src := $.Get "src" }} {{ $image := .Page.Resources.GetMatch (.Get "src") }} {{ $file := path.Join (path.Dir .Page.File.Path) $image }} {{ $stat := os.Stat $file }} {{ $alt := $.Get "alt" }} {{ $id := $.Get "id" }} {{ $caption := $.Get "caption" | markdownify }} {{ $style := $.Get "style" }} {{- $figureCounter := .Page.Scratch.Get "figureCounter" | default 1 }} {{- $.Page.Scratch.Set "figureCounter" (add $figureCounter 1) }} {{- with .Get "src" }} {{- $src := . }} {{- $image := resources.GetMatch . }} {{- if $image }} {{- $alt = $image.Title }} {{- end }}
{{- else }} {{- errorf "missing value for param 'name': %s" .Position }} {{- end }}