uci-shortcodes/layouts/shortcodes/image.html

27 lines
830 B
HTML
Raw Permalink Normal View History

{{ $path := "/images/" }}
{{ $filename := .Get "filename" }}
{{ with $.Site.Params.imagespath }} {{ $path := ( . ) }}{{ end }}
<div class="box box--column box--image
{{ with .Get "style"}} box--image-{{ . }}{{ end }}
{{ with .Get "link"}}{{ if eq . "lightbox" }} box--image-lightbox{{ end }}{{ end }}
"
style="
{{ with .Get "width"}} width:{{ . }};{{ end }}
{{ with .Get "pad"}} padding:{{ . }}{{ end }}
"
>
{{ with .Get "title" }}<div class="box__title">{{ . }}</div>{{ end }}
<a href="{{ if .Get "link" }}{{ .Get "link" }}{{ else }}{{ $path }}{{ $filename }}{{ end }}" target="_blank" >
<img
style="
{{ with .Get "width"}} width={{ . }};{{ end }}
{{ with .Get "pad"}} padding={{ . }}{{ end }}
"
src="{{ $path }}{{ .Get "filename" }}" />
</a>
{{ with .Get "caption"}}
<div class="box__caption">{{ . }}</div>
{{ end }}
</div>