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

github.com/themefisher/vex-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraterbrain <58347640+Craterbrain@users.noreply.github.com>2021-04-28 23:41:48 +0300
committerGitHub <noreply@github.com>2021-04-28 23:41:48 +0300
commitc00fc8a48e9195f91807ab33d4b823d2534e2c12 (patch)
treeba2c570e2503dad0ea2bccad6bd561fc346d6ddf
parentf4e7f51804660fa0ee1e157cd318b27a23b0716b (diff)
Fixed "execute of template failed: template: products/single.html:28:35: executing "main" at <first 1 .Params.Images>: error calling first: both limit and seq must be provided"
In Hugo 82 the way this was done now fails site generation. I found the fix so I'm submitting a patch.
-rw-r--r--layouts/products/single.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/products/single.html b/layouts/products/single.html
index b68f05c..201ccd7 100644
--- a/layouts/products/single.html
+++ b/layouts/products/single.html
@@ -23,7 +23,7 @@
<button class="snipcart-add-item btn btn-main mb-5"
data-item-id="{{.Title | urlize}}__{{if .Params.discount_price}}{{.Params.discount_price}}{{else}}{{.Params.price}}{{end}}"
data-item-name="{{.Title}}"
- data-item-image="{{range first 1 .Params.Images}}{{. | absURL}}{{end}}"
+ data-item-image="{{with .Params.Images}} {{range first 1 . }}{{. | absURL}}{{end}}{{end}}"
data-item-price="{{if .Params.discount_price}}{{.Params.discount_price}}{{else}}{{.Params.price}}{{end}}" data-item-url="{{.Permalink}}"
{{ if .Params.colors }}
data-item-custom1-name="Choose Color"