add video shortcode

This commit is contained in:
Dmitry Kolosov 2023-08-03 18:36:21 +02:00
parent cdc5532b60
commit 2cdfded2e5
5 changed files with 39 additions and 2 deletions

View file

@ -0,0 +1,20 @@
<video
class="video-shortcode"
preload="{{ .Get "preload" | default "auto" }}"
controls
>
<source
src="{{ .Get "src" }}"
type="{{ .Get "type" }}"
{{ if or (.Get "alt") (.Get "caption") }}
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify | plainify }}{{ end }}"
{{ end }}
>
{{ i18n "videoIsNotSupported" }}
</video>
{{ if .Get "caption" }}
<figcaption>
{{ .Get "caption" | markdownify }}
</figcaption>
{{ end }}