diff options
author | Yoshiharu Yamashita <yoshiharu.yamashita@outlook.com> | 2016-03-08 01:16:07 +0300 |
---|---|---|
committer | Yoshiharu Yamashita <yoshiharu.yamashita@outlook.com> | 2016-03-08 01:16:07 +0300 |
commit | b8e2f994927206122385a6231069fee9a7e0db3a (patch) | |
tree | 057b045c5c5bd0525a9d6d61b631af1c6c40f3fb /layouts | |
parent | a3386d47177a4c6e84da7ac350aaad73e6ddd08a (diff) |
Extend img shortcode to take params like alt
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/shortcodes/fluid_img.html | 8 |
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 |