Update figure shortcode to properly float left and right

This commit is contained in:
Justin Nguyen
2020-12-22 19:18:44 -08:00
parent 734364f330
commit 0b270e29cf
7 changed files with 22 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
{{ if .Get "src" }}
<figure class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" >
<figure class="{{ with .Get "position"}}{{ . }}{{ else -}} center {{- end }}" {{ with .Get "containerStyle" }} style="{{ . | safeCSS }}" {{ end }} >
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
{{ if .Get "caption" }}
<figcaption class="{{ with .Get "captionPosition"}}{{ . }}{{ else -}} center {{- end }}" {{ with .Get "captionStyle" }} style="{{ . | safeCSS }}" {{ end }}>{{ .Get "caption" | safeHTML }}</figcaption>