Files
davideisinger.com/themes/v2/layouts/shortcodes/thumbnail.html
2023-04-30 22:33:46 -04:00

20 lines
456 B
HTML

{{ $orig := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
{{ $options := .Get 1 }}
{{ $img := $orig.Resize $options }}
{{ if findRE `\d+x\d+` $options }}
{{ $img = $orig.Fill $options }}
{{ end }}
<a href="{{ $orig.RelPermalink }}">
<figure>
<img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}">
{{ with .Inner }}
<figcaption>
{{ . }}
</figcaption>
{{ end }}
</figure>
</a>