timgproc.html - andersdamsgaard.com - my photography webpage
(HTM) git clone git://src.adamsgaard.dk/andersdamsgaard.com
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
timgproc.html (736B)
---
1 {{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
2 {{ $command := .Get 1 }}
3 {{ $options := .Get 2 }}
4 {{ if eq $command "Fit"}}
5 {{ .Scratch.Set "image" ($original.Fit $options) }}
6 {{ else if eq $command "Resize"}}
7 {{ .Scratch.Set "image" ($original.Resize $options) }}
8 {{ else if eq $command "Fill"}}
9 {{ .Scratch.Set "image" ($original.Fill $options) }}
10 {{ else }}
11 {{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize."}}
12 {{ end }}
13 {{ $image := .Scratch.Get "image" }}
14 <figure style="padding: 0.0rem; margin: 0rem 0; background-color: #ffffff">
15 <img style="max-width: 100%; height: auto;" src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}">
16 </figure>