add dithering example

This commit is contained in:
David Eisinger
2024-02-12 17:15:43 -05:00
parent 4012b4dc03
commit 0669cd273b
5 changed files with 42 additions and 5 deletions

View File

@@ -0,0 +1,17 @@
{{ $orig := .Page.Resources.GetMatch (.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>