From 02ded1c5a9690c390923a70de44488eb475ae8f1 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 14 Jul 2018 22:59:40 -0700 Subject: [PATCH] Merge the gifv shortcode into imgs, auto-detecting the file type --- layouts/shortcodes/gifv.html | 19 ------------------- layouts/shortcodes/imgs.html | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 23 deletions(-) delete mode 100644 layouts/shortcodes/gifv.html diff --git a/layouts/shortcodes/gifv.html b/layouts/shortcodes/gifv.html deleted file mode 100644 index 503d15a..0000000 --- a/layouts/shortcodes/gifv.html +++ /dev/null @@ -1,19 +0,0 @@ - -
- {{ range $param := .Params }} - - {{ $items := split $param "|" }} - {{ $src := (index $items 0) }} - {{ $title := (index $items 1) }} -
- - - {{ if $title }} -

{{ $title }}

- {{ end }} -
- {{ end }} -
diff --git a/layouts/shortcodes/imgs.html b/layouts/shortcodes/imgs.html index f5fa671..cce9b95 100644 --- a/layouts/shortcodes/imgs.html +++ b/layouts/shortcodes/imgs.html @@ -4,13 +4,22 @@ {{ $items := split $param "|" }} {{ $src := (index $items 0) }} {{ $title := (index $items 1) }} + {{ $split_src := split $src "." }} + {{ $extension := index $split_src (sub (len $split_src) 1) }}
- - {{ $title }} - + {{ if eq $extension "mp4" }} + + {{ else }} + + {{ $title }} + + {{ end }} {{ if $title }}

{{ $title }}

{{ end }}
{{ end }} - \ No newline at end of file +