blob: e0779981f051534ce7997891d8656c27ccb76405 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
{{$original := .bundle.Resources.GetMatch .path}}
{{$command := .cmd | default "Fill"}}
{{$options := .options}}
{{$image := dict "RelPermalink" ""}}
{{with $original}}
{{if eq $command "Fill"}}
{{$image = $original.Fill $options}}
{{else if eq $command "Fit"}}
{{$image = $original.Fit $options}}
{{else if eq $command "Resize"}}
{{$image = $original.Resize $options}}
{{else}}
{{errorf "Invalid image processing command: Must be one of Fit, Fill or Resize."}}
{{end}}
{{end}}
{{return $image}}
|