mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-12 09:47:29 -05:00
Add figure shortcode
This commit is contained in:
24
layouts/shortcodes/figure.html
Normal file
24
layouts/shortcodes/figure.html
Normal file
@ -0,0 +1,24 @@
|
||||
<figure>
|
||||
|
||||
{{ if .Get "href" }}<a href="{{ .Get "href" }}">{{ end }}
|
||||
<img src="{{ .Get "src" }}"
|
||||
{{ if or (.Get "alt") (.Get "caption") }}
|
||||
alt="{{ with .Get "alt" }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
{{ .Get "caption" | markdownify }}
|
||||
{{ end }}"
|
||||
{{ end }}
|
||||
|
||||
{{ with .Get "width" }} width="{{ . }}" {{ end }}
|
||||
{{ with .Get "height" }} height="{{ . }}" {{ end }}
|
||||
/>
|
||||
{{ if .Get "href" }}</a>{{ end }}
|
||||
|
||||
{{ with .Get "caption" }}
|
||||
<figcaption>
|
||||
{{ . | markdownify }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
|
||||
</figure>
|
Reference in New Issue
Block a user