summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/figure.html7
1 files changed, 5 insertions, 2 deletions
diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html
index 71aebb1..77f188e 100644
--- a/layouts/shortcodes/figure.html
+++ b/layouts/shortcodes/figure.html
@@ -1,8 +1,11 @@
-<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
+<figure{{ if or (.Get "class") (eq (.Get "align") "center") }} class="
+ {{- if eq (.Get "align") "center" }}align-center {{ end }}
+ {{- with .Get "class" }}{{ . }}{{- end }}"
+{{- end -}}>
{{- if .Get "link" -}}
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
{{- end }}
- <img src="{{ .Get "src" }}"
+ <img src="{{ .Get "src" }}{{- if eq (.Get "align") "center" }}#center{{- end }}"
{{- if or (.Get "alt") (.Get "caption") }}
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
{{- end -}}