File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939
4040*/}}
4141
42- {{- $figure := .Inner | transform.Unmarshal -}}
42+ {{- $useParams := true -}}
43+ {{- $figure := dict -}}
44+
45+ {{- if strings.TrimSpace .Inner -}}
46+ {{- if not .IsNamedParams -}}
47+ {{- $useParams = false -}}
48+ {{- $figure = .Inner | transform.Unmarshal -}}
49+ {{- end -}}
50+ {{- end -}}
51+
52+ {{/* If we're using params, collect them. */}}
53+ {{- if $useParams -}}
54+ {{- range $key, $value := .Params -}}
55+ {{- $figure = merge $figure (dict $key $value) -}}
56+ {{- end -}}
57+ {{- end -}}
58+
4359{{- $align := default "default" $figure.align -}}
4460{{- $id := printf "id%03d" $.Ordinal -}}
61+
4562< figure class ="align-{{ $align }} " id ="{{ $id }} ">
46- {{- $m := newScratch - }}
47- {{- $m.Set " image" $figure -}}
48- {{- $m.SetInMap " image" "align" "center" - }}
49- {{ partial "_elements/image.html" (dict "data" $m.Values.image) }}
63+ {{/* Create a clean copy of figure data with align center for image */ }}
64+ {{- $image := merge $figure (dict "align" "center") -}}
65+ {{ partial "_elements/ image.html" (dict "data" $image) }}
66+
5067< figcaption >
5168{{- with $figure.title -}}
5269< strong class ="caption-title "> {{ . }}</ strong > < a class ="headerlink " href ="#{{ $id }} " title ="Link to this image "> #</ a > < br >
You can’t perform that action at this time.
0 commit comments