File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change 39
39
40
40
*/}}
41
41
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
+
43
59
{{- $align := default "default" $figure.align -}}
44
60
{{- $id := printf "id%03d" $.Ordinal -}}
61
+
45
62
< 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
+
50
67
< figcaption >
51
68
{{- with $figure.title -}}
52
69
< 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