chill_hugoplate/themes/hugoplate/layouts/shortcodes/place-image.html

26 lines
622 B
HTML
Raw Permalink Normal View History

{{/* layouts/shortcodes/place-image.html */}}
{{ $base := ref . "." }}
{{ $src := .Get "src" }}
{{ $baseSrc := print $base $src }}
{{ $alt := .Get "alt" }}
{{ $class := .Get "class" }}
{{ $float := .Get "float" }}
{{ $width := .Get "width" }}
{{ $height := .Get "height" }}
<figure class="image {{ with $float }}{{ $float }}{{ else }}center{{ end }}">
<img src="{{ $baseSrc }}"
alt="{{ $alt }}"
class="{{ $class }}"
width="{{ $width }}"
height="{{ $height }}"
>
{{ with .Get "caption" }}
<figcaption>
{{ . }}
</figcaption>
{{ end }}
</figure>