From 43b3bce94c72f149564d99dba7082ca348643d4d Mon Sep 17 00:00:00 2001 From: James Date: Mon, 10 Sep 2018 20:46:31 +1000 Subject: [PATCH] Add single title image shortcode --- layouts/shortcodes/single-title-imgs.html | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 layouts/shortcodes/single-title-imgs.html diff --git a/layouts/shortcodes/single-title-imgs.html b/layouts/shortcodes/single-title-imgs.html new file mode 100644 index 0000000..8cde95e --- /dev/null +++ b/layouts/shortcodes/single-title-imgs.html @@ -0,0 +1,27 @@ +{{ $title := .Get 0 }} +
+ {{ range $param := last (sub (len .Params) 1) .Params }} + + {{ $items := split $param "|" }} + {{ $src := (index $items 0) }} + {{ $subtitle := (index $items 1) }} + {{ $split_src := split $src "." }} + {{ $extension := index $split_src (sub (len $split_src) 1) }} +
+ {{ if eq $extension "mp4" }} + + {{ else }} + + {{ $subtitle }} + + {{ end }} +
+ {{ end }} +
+ +{{ if $title }} +

{{ $title }}

+{{ end }}