Skip to content

Commit 4dc3fcb

Browse files
Center image in figures (#554)
1 parent 3c6e508 commit 4dc3fcb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

layouts/shortcodes/figure.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
{{- $align := default "default" $figure.align -}}
4444
{{- $id := printf "id%03d" $.Ordinal -}}
4545
<figure class="align-{{ $align }}" id="{{ $id }}">
46-
{{ partial "_elements/image.html" (dict "data" $figure) }}
46+
{{- $m := newScratch -}}
47+
{{- $m.Set "image" $figure -}}
48+
{{- $m.SetInMap "image" "align" "center" -}}
49+
{{ partial "_elements/image.html" (dict "data" $m.Values.image) }}
4750
<figcaption>
4851
{{- with $figure.title -}}
4952
<strong class="caption-title">{{ . }}</strong><a class="headerlink" href="#{{ $id }}" title="Link to this image">#</a><br>

0 commit comments

Comments
 (0)