Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/yoshiharuyamashita/blackburn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoshiharu Yamashita <yoshiharuyamashita@outlook.com>2017-07-30 09:29:34 +0300
committerYoshiharu Yamashita <yoshiharuyamashita@outlook.com>2017-07-30 09:29:34 +0300
commit307ad99b0ff51a3641d7792ddf4941a650e4cd92 (patch)
tree36ce81c5d6ef8e47f93a14043348d661722dc263 /layouts
parent6378e9a42fc7776843b757cbccafb459ffec2b21 (diff)
Add shortcode to show multiple images
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/fluid_imgs.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/layouts/shortcodes/fluid_imgs.html b/layouts/shortcodes/fluid_imgs.html
new file mode 100644
index 0000000..f899772
--- /dev/null
+++ b/layouts/shortcodes/fluid_imgs.html
@@ -0,0 +1,21 @@
+{{ $paramCount := len .Params }}
+{{ if gt $paramCount 0 }}
+<div class="pure-g">
+{{ range $param := .Params }}
+ {{ $items := split $param "|" }}
+ {{ $itemCount := len $items }}
+ <!-- Item count must be at least 2 as
+ "class" and "src" must be specified -->
+ {{ if ge $itemCount 2 }}
+ <div class="{{ index $items 0 }}">
+ <div style="padding: 0 .2em">
+ <img
+ class="pure-img-responsive"
+ src="{{ index $items 1 }}"
+ alt="{{ if ge $itemCount 3 }}{{ index $items 2 }}{{ else }}{{ "" }}{{ end }}">
+ </div>
+ </div>
+ {{ end }}
+{{ end }}
+</div>
+{{ end }} \ No newline at end of file