diff options
author | Humberto Rocha <humrochagf@gmail.com> | 2019-08-07 23:42:18 +0300 |
---|---|---|
committer | Humberto Rocha <humrochagf@gmail.com> | 2019-08-07 23:42:18 +0300 |
commit | a55919fd662dd0817f816d9a3c142b2929ee323d (patch) | |
tree | 23f6becf6c79c57473c6fa1c6ce86ebf069ef0a6 /layouts | |
parent | 5f78c95c64ef49f1cf59460737e9133588713431 (diff) |
Add videogif shortcode
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/shortcodes/videogif.html | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/layouts/shortcodes/videogif.html b/layouts/shortcodes/videogif.html new file mode 100644 index 0000000..a668126 --- /dev/null +++ b/layouts/shortcodes/videogif.html @@ -0,0 +1,17 @@ +<video class="videogif" autoplay loop muted inline> + {{ range .Params }} + {{ $extension := path.Ext . }} + + {{ if eq $extension ".webm" }} + <source src="{{ . }}" type="video/webm"> + {{ end }} + + {{ if eq $extension ".mp4" }} + <source src="{{ . }}" type="video/mp4"> + {{ end }} + + {{ if eq $extension ".gif" }} + <img src="{{ . }}" /> + {{ end }} + {{ end }} +</video> |