Add a few new shortcodes

This commit is contained in:
2021-10-30 00:23:49 -05:00
parent 33fbcac9d5
commit 550bfb6367
3 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,27 @@
{{ $hidecaption := index . "hidecaption" }}
{{ $type := index . "type" }}
{{ $src := index . "src" }}
{{ $alt := index . "alt" }}
{{ if index . "border" }}
<figure class="border">
{{ else }}
<figure>
{{ end }}
{{ if eq $type "image" }}
<img src="{{ $src }}" alt="{{ $alt }}" />
{{ else if eq $type "video" }}
<video controls>
<source src="{{ $src }}" alt="{{ $alt }}">
{{ i18n "browser_no_video_support" }}
</video>
{{ end }}
{{ if not $hidecaption }}
{{ with $alt }}
<figcaption>
{{ . | markdownify }}
</figcaption>
{{ end }}
{{ end }}
</figure>