Add thumbnail shortcode

This commit is contained in:
David Eisinger
2023-04-03 20:57:39 -04:00
parent e1f174a6f6
commit c3fa4f5120

View File

@@ -0,0 +1,14 @@
{{ $orig := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
{{ $options := .Get 1 }}
{{ $img := $orig.Fill $options }}
<figure>
<a href="{{ $orig.RelPermalink }}">
<img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}">
<figcaption>
{{ with .Inner }}
{{ . }}
{{ end }}
</figcaption>
</a>
</figure>