add local position var

This commit is contained in:
Adam Ormsby 2020-01-29 12:45:05 +07:00
parent 51d17bbce6
commit b7a187917b

View File

@ -1,6 +1,7 @@
{{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
{{ $command := .Get 1 }}
{{ $options := .Get 2 }}
{{ $position := .Get 3}}
{{ if eq $command "Fit"}}
{{ .Scratch.Set "image" ($original.Fit $options) }}
@ -14,7 +15,7 @@
{{ $image := .Scratch.Get "image" }}
<figure class="{{ with .Get 3}}{{ . }}{{ else -}} left {{- end }}" >
<figure class="{{ with $position }}{{ . }}{{ else -}} left {{- end }}" >
<img style="max-width: 100%; width: auto; height: auto; border-radius: 8px;" src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}">
{{ with .Inner }}
<figcaption>