Uniq producing error with hugolib.Page

When using uniq on an array of pages, (created by appending pages objects to a slice), hugo produces the following error:

Failed to render pages: render of "page" failed: execute of template failed: panic in Execute: reflect.Set: value of type hugolib.Page is not assignable to type *hugolib.Page.

I wonder if this would be addressed once PR 5702 is merged?

This is likely a bug. Either share a simple snippet from your template that demonstrates the issue or share a minimal proof-of-concept site.

1 Like

Will do! Thanks.

Here you go: Here’s the repo and the line in question

Thanks a ton!

That said, It will most likely be fixed by the mentioned PR, so I would wait a little before looking into it.

2 Likes