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 <yoshiharu.yamashita@outlook.com>2016-03-08 01:16:07 +0300
committerYoshiharu Yamashita <yoshiharu.yamashita@outlook.com>2016-03-08 01:16:07 +0300
commitb8e2f994927206122385a6231069fee9a7e0db3a (patch)
tree057b045c5c5bd0525a9d6d61b631af1c6c40f3fb /layouts
parenta3386d47177a4c6e84da7ac350aaad73e6ddd08a (diff)
Extend img shortcode to take params like alt
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/fluid_img.html8
1 files changed, 7 insertions, 1 deletions
diff --git a/layouts/shortcodes/fluid_img.html b/layouts/shortcodes/fluid_img.html
index 6d3d66a..6930dd9 100644
--- a/layouts/shortcodes/fluid_img.html
+++ b/layouts/shortcodes/fluid_img.html
@@ -1 +1,7 @@
-<img src="{{ index .Params 0 }}" alt="" class="pure-img" >
+{{ if .IsNamedParams }}
+<div class="{{ if .Get "class" }}{{ .Get "class" }}{{ else }}pure-u-1{{ end }}">
+ <img class="pure-img" src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }}>
+</div>
+{{ else }}
+<img class="pure-img" src="{{ index .Params 0 }}" alt="">
+{{ end }} \ No newline at end of file