Cleanup shortcode template
This commit is contained in:
parent
5a4882634f
commit
4184aad3fe
2 changed files with 2 additions and 15 deletions
|
@ -1,5 +1,3 @@
|
|||
{{ $style := default "btn-outline-dark" (.Get "style" )}}
|
||||
|
||||
<a class="btn {{ $style }} my-2" href='{{ .Get "src" }}'>
|
||||
<a class="btn btn-outline-dark my-2" href='{{ .Get "src" }}'>
|
||||
{{ .Inner }}
|
||||
</a>
|
||||
|
|
|
@ -1,18 +1,7 @@
|
|||
{{ $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 }}
|
||||
|
||||
|
||||
{{ define "img" }}
|
||||
{{ $image := .Scratch.Get "image" }}
|
||||
|
|
Loading…
Reference in a new issue