add video shortcode
This commit is contained in:
parent
cdc5532b60
commit
2cdfded2e5
5 changed files with 39 additions and 2 deletions
20
layouts/shortcodes/video.html
Normal file
20
layouts/shortcodes/video.html
Normal 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 }}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue