diff options
-rwxr-xr-x | layouts/gallery/list.html | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/layouts/gallery/list.html b/layouts/gallery/list.html index 733d00b..0b6f21f 100755 --- a/layouts/gallery/list.html +++ b/layouts/gallery/list.html @@ -3,8 +3,9 @@ {{ .Content }} </article> +{{ $keepAspectRatio := default false .Params.keepAspectRatio }} {{ if .Params.clickablePhotos }} - <div class="grid {{ cond .Params.keepAspectRatio "keep-aspect-ratio" ""}}"> + <div class="grid {{ cond $keepAspectRatio "keep-aspect-ratio" "" }}"> {{ $images := .Resources.ByType "image" }} {{ range $index, $element := shuffle $images }} {{ $resized := $element.Resize $.Params.maxWidth }} @@ -16,7 +17,7 @@ {{ end }} </div> {{ else }} - <div class="grid"> + <div class="grid {{ cond $keepAspectRatio "keep-aspect-ratio" "" }}"> {{ $images := .Resources.ByType "image" }} {{ range shuffle $images }} {{ $resized := .Resize $.Params.maxWidth }} |