diff options
author | Arthur Bailão <arthurbailao@gmail.com> | 2020-08-24 02:40:09 +0300 |
---|---|---|
committer | Arthur Bailão <arthurbailao@gmail.com> | 2020-08-24 02:40:09 +0300 |
commit | dbb5a3153a4ae732a6157b3acce20c9fbf8583fb (patch) | |
tree | 35fd0b1d3926ce0d3d78efb134427905c5bc9542 | |
parent | 998e76c4568c93f7fbdb47ecc1fba015260e91ab (diff) |
bug fix
-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 }} |