27 lines
778 B
HTML
27 lines
778 B
HTML
{{ $original := .Page.Resources.GetMatch (.Get "src") }}
|
|
{{ $options := default "1000x" (.Get "options") }}
|
|
|
|
{{ .Scratch.Set "image" $original }}
|
|
|
|
{{ $command := (default "Resize" (.Get "command")) }}
|
|
|
|
{{ if eq $command "Fit"}}
|
|
{{ .Scratch.Set "image" ($original.Fit $options) }}
|
|
{{ else if eq $command "Resize"}}
|
|
{{ .Scratch.Set "image" ($original.Resize $options) }}
|
|
{{ else if eq $command "Fill"}}
|
|
{{ .Scratch.Set "image" ($original.Fill $options) }}
|
|
{{ end }}
|
|
|
|
{{ $image := .Scratch.Get "image" }}
|
|
|
|
{{ if .Inner }}
|
|
<figure>
|
|
<img src="{{ $image.RelPermalink }}" class='{{ .Get "class" }}' />
|
|
<figcaption>
|
|
<small>{{ .Inner }}</small>
|
|
</figcaption>
|
|
</figure>
|
|
{{ else }}
|
|
<img src="{{ $image.RelPermalink }}" class='{{ .Get "class" }}' />
|
|
{{ end }}
|