diff options
author | Craterbrain <58347640+Craterbrain@users.noreply.github.com> | 2021-04-28 23:41:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-28 23:41:48 +0300 |
commit | c00fc8a48e9195f91807ab33d4b823d2534e2c12 (patch) | |
tree | ba2c570e2503dad0ea2bccad6bd561fc346d6ddf | |
parent | f4e7f51804660fa0ee1e157cd318b27a23b0716b (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.html | 2 |
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" |