Files
davideisinger.com/themes/v2/layouts/shortcodes/thumbnail.html
David Eisinger 87f702bb3d Better image CSS
2024-01-10 22:03:32 -05:00

18 lines
442 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 (printf "%s center" $options) }}
{{ end }}
<a href="{{ $orig.RelPermalink }}">
<img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}">
{{ with .Inner }}
<figcaption>
{{ . }}
</figcaption>
{{ end }}
</a>