Add figure shortcode
This commit is contained in:
parent
4845a3db96
commit
aa1abb8fcd
3 changed files with 46 additions and 1 deletions
8
layouts/shortcodes/figure.html
Normal file
8
layouts/shortcodes/figure.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
{{ if .Get "src" }}
|
||||
<figure class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- 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" }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue