2022-06-28 22:46:02 -04:00
|
|
|
{{ $img := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
|
|
|
|
{{ $command := .Get 1 }}
|
|
|
|
{{ $options := .Get 2 }}
|
|
|
|
{{ $figclass := .Get 3 }}
|
|
|
|
{{ $imgclass := .Get 4 }}
|
2023-02-25 00:13:45 -05:00
|
|
|
{{ if eq $command "Fit" }}
|
2022-06-28 22:46:02 -04:00
|
|
|
{{ $img = $img.Fit $options }}
|
2023-02-25 00:13:45 -05:00
|
|
|
{{ else if eq $command "Resize" }}
|
2022-06-28 22:46:02 -04:00
|
|
|
{{ $img = $img.Resize $options }}
|
2023-02-25 00:13:45 -05:00
|
|
|
{{ else if eq $command "Fill" }}
|
2022-06-28 22:46:02 -04:00
|
|
|
{{ $img = $img.Fill $options }}
|
2023-02-25 00:13:45 -05:00
|
|
|
{{ else if eq $command "Crop" }}
|
2022-06-28 22:46:02 -04:00
|
|
|
{{ $img = $img.Crop $options }}
|
|
|
|
{{ else }}
|
2023-02-25 00:13:45 -05:00
|
|
|
{{ errorf "Invalid image processing command: Must be one of Crop, Fit, Fill or Resize." }}
|
2022-06-28 22:46:02 -04:00
|
|
|
{{ end }}
|
|
|
|
<figure class="figure {{ $figclass }}">
|
2023-02-25 00:13:45 -05:00
|
|
|
<img
|
|
|
|
class="figure-img img img-fluid"
|
|
|
|
src="{{ $img.RelPermalink }}"
|
|
|
|
width="{{ $img.Width }}"
|
|
|
|
height="{{ $img.Height }}"
|
|
|
|
/>
|
|
|
|
{{ with .Inner }}
|
|
|
|
<figcaption class="figure-caption">
|
|
|
|
<small>
|
|
|
|
{{ . | markdownify }}
|
|
|
|
</small>
|
|
|
|
</figcaption>
|
|
|
|
{{ end }}
|
2022-06-28 22:46:02 -04:00
|
|
|
</figure>
|