commit c3fa4f512098eea2194b489353df113c2fc6499a parent e1f174a6f65deb01dd798ffbbf8242338856702f Author: David Eisinger <[email protected]> Date: Mon, 3 Apr 2023 20:57:39 -0400 Add thumbnail shortcode Diffstat:
| A | themes/v2/layouts/shortcodes/thumbnail.html | | | 14 | ++++++++++++++ |
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/themes/v2/layouts/shortcodes/thumbnail.html b/themes/v2/layouts/shortcodes/thumbnail.html @@ -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>