26 lines
622 B
HTML
26 lines
622 B
HTML
{{/* 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>
|