mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-11-17 13:25:57 -06:00
Add figure shortcode
This commit is contained in:
parent
c4e7258d69
commit
b51c6c257f
@ -106,6 +106,12 @@ img:not(.noborder), video:not(.noborder) {
|
||||
border: 5px solid #1b5b9b;
|
||||
}
|
||||
|
||||
figcaption {
|
||||
font-style: italic;
|
||||
font-size: small;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #4da6ff;
|
||||
text-decoration: inherit;
|
||||
|
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>
|
Loading…
Reference in New Issue
Block a user