-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Description
What version of Hugo are you using (hugo version
)?
$ hugo version hugo v0.121.1-00b46fed8e47f7bb0a85d7cfc2d9f1356379b740+extended darwin/arm64 BuildDate=2023-12-08T08:47:45Z VendorInfo=brew
Does this issue reproduce with the latest release?
The part of the template that seems to break is the following:
{{ $.Scratch.Add "sortedPages" slice }}
{{ range .RegularPages.ByDate.Reverse }}
{{ if not .Params.out_of_stock }}
{{ $.Scratch.Add "sortedPages" (slice .) }}
{{ end }}
{{ end }}
{{ range .RegularPages.ByDate.Reverse }}
{{ if .Params.out_of_stock }}
{{ $.Scratch.Add "sortedPages" (slice .) }}
{{ end }}
{{ end }}
{{ $paginator := .Paginate ($.Scratch.Get "sortedPages") }}
The generated error is:
render of "section" failed: �[1;36m"/Users/camille/Developer/Home/reactionair.nl/layouts/shop/list.html:73:18"�[0m: execute of template failed at <.Paginate>: error calling Paginate: cannot convert type []interface {} to Pages Failed to render "/winkel/": render: failed to render pages: cannot convert type []interface {} to Pages
{{ $paginator := .Paginate ($.Scratch.Get "sortedPages") }}
This only happens when running hugo serve
, not hugo
or Hugo serve --disableFastRender
.