Fetch thumbnails from dither server
This commit is contained in:
@@ -1,13 +1,8 @@
|
|||||||
{{ $orig := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
|
{{ $file := printf "%s%s" .Page.RelPermalink (.Get 0) }}
|
||||||
{{ $options := .Get 1 }}
|
{{ $geo := .Get 1 }}
|
||||||
|
{{ $img := resources.GetRemote (printf "%s%s?geo=%s" (getenv "DITHER_SERVER") $file $geo) }}
|
||||||
|
|
||||||
{{ $img := $orig.Resize $options }}
|
<a href="{{ $img.RelPermalink }}">
|
||||||
|
|
||||||
{{ 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 }}">
|
<img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}">
|
||||||
{{ with .Inner }}
|
{{ with .Inner }}
|
||||||
<figcaption>
|
<figcaption>
|
||||||
|
|||||||
Reference in New Issue
Block a user