gmgauthier.com/themes/blackburn/layouts/shortcodes/fluid_img.html

7 lines
357 B
HTML
Raw Normal View History

2021-03-30 20:50:34 +00:00
{{ 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 }}