summaryrefslogtreecommitdiffstats
path: root/docs/layouts/shortcodes/imgproc.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/layouts/shortcodes/imgproc.html')
-rw-r--r--docs/layouts/shortcodes/imgproc.html35
1 files changed, 17 insertions, 18 deletions
diff --git a/docs/layouts/shortcodes/imgproc.html b/docs/layouts/shortcodes/imgproc.html
index 181e97f1d..f792702ce 100644
--- a/docs/layouts/shortcodes/imgproc.html
+++ b/docs/layouts/shortcodes/imgproc.html
@@ -1,27 +1,26 @@
-{{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
+{{ $img := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
{{ $command := .Get 1 }}
{{ $options := .Get 2 }}
{{ if eq $command "Fit"}}
-{{ .Scratch.Set "image" ($original.Fit $options) }}
+ {{ $img = $img.Fit $options }}
{{ else if eq $command "Resize"}}
-{{ .Scratch.Set "image" ($original.Resize $options) }}
+ {{ $img = $img.Resize $options }}
{{ else if eq $command "Fill"}}
-{{ .Scratch.Set "image" ($original.Fill $options) }}
+ {{ $img = $img.Fill $options }}
{{ else if eq $command "Crop"}}
-{{ .Scratch.Set "image" ($original.Crop $options) }}
+ {{ $img = $img.Crop $options }}
{{ else }}
-{{ errorf "Invalid image processing command: Must be one of Crop, Fit, Fill or Resize."}}
+ {{ errorf "Invalid image processing command: Must be one of Crop, Fit, Fill or Resize."}}
{{ end }}
-{{ $image := .Scratch.Get "image" }}
<figure style="padding: 0.25rem; margin: 2rem 0; background-color: #cccc">
- <img style="max-width: 100%; width: auto; height: auto;" src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}">
- <figcaption>
- <small>
- {{ with .Inner }}
- {{ . }}
- {{ else }}
- .{{ $command }} "{{ $options }}"
- {{ end }}
- </small>
- </figcaption>
-</figure> \ No newline at end of file
+ <img style="max-width: 100%; width: auto; height: auto;" src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}">
+ <figcaption>
+ <small>
+ {{ with .Inner }}
+ {{ . }}
+ {{ else }}
+ .{{ $command }} "{{ $options }}"
+ {{ end }}
+ </small>
+ </figcaption>
+</figure>