commit b308f7227e2913f02ab06ae306bd26307f2b1d11 parent d1390eaaeec46fb0d93cd13e06bc3f330d6a9162 Author: David Eisinger <[email protected]> Date: Thu, 1 Feb 2024 22:56:22 -0500 Fetch thumbnails from dither server Diffstat:
| M | themes/v2/layouts/shortcodes/thumbnail.html | | | 13 | ++++--------- |
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/themes/v2/layouts/shortcodes/thumbnail.html b/themes/v2/layouts/shortcodes/thumbnail.html @@ -1,13 +1,8 @@ -{{ $orig := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }} -{{ $options := .Get 1 }} +{{ $file := printf "%s%s" .Page.RelPermalink (.Get 0) }} +{{ $geo := .Get 1 }} +{{ $img := resources.GetRemote (printf "%s%s?geo=%s" (getenv "DITHER_SERVER") $file $geo) }} -{{ $img := $orig.Resize $options }} - -{{ if findRE `\d+x\d+` $options }} - {{ $img = $orig.Fill (printf "%s center" $options) }} -{{ end }} - -<a href="{{ $orig.RelPermalink }}"> +<a href="{{ $img.RelPermalink }}"> <img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}"> {{ with .Inner }} <figcaption>