This commit is contained in:
infidel
2022-11-14 23:16:26 +07:00
commit b6f9e18e61
123 changed files with 66289 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
{{ $command := .Get "command" }}
{{ $options := .Get "options" }}
{{ with .Page.Resources.ByType "image" }}
{{ range . }}
{{ $original := . }}
{{ $new := "" }}
{{ if eq $command "Fit" }}
{{ $new = $original.Fit $options }}
{{ else if eq $command "Fill" }}
{{ $new = $original.Fill $options }}
{{ else if eq $command "Resize" }}
{{ $new = $original.Resize $options }}
{{ else if eq $command "Original" }}
{{ $new = $original }}
{{ else }}
{{ errorf "Invalid image processing command: Must be one of Fit, Fill, Resize, Original." }}
{{ end }}
<div class="gallery">
<a href="{{ $original.RelPermalink }}" class="img-link">
<img src="{{ $new.RelPermalink }}">
</a>
</div>
{{ end }}
{{ end }}