Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/hivickylai/hugo-theme-sam.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Bailão <arthurbailao@gmail.com>2020-08-24 02:40:09 +0300
committerArthur Bailão <arthurbailao@gmail.com>2020-08-24 02:40:09 +0300
commitdbb5a3153a4ae732a6157b3acce20c9fbf8583fb (patch)
tree35fd0b1d3926ce0d3d78efb134427905c5bc9542
parent998e76c4568c93f7fbdb47ecc1fba015260e91ab (diff)
bug fix
-rwxr-xr-xlayouts/gallery/list.html5
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 }}