Error while building: "can't evaluate field ByWeight in type []interface {}"
carpikes opened this issue · 2 comments
carpikes commented
Hello, I'm having some issues in replicating the Setup as described in the readme. This is what happens:
$ hugo new site yourproject
Congratulations! Your new Hugo site was created in /tmp/yourproject.
$ cd yourproject
$ hugo new yourpost.md
Content "/tmp/yourproject/content/yourpost.md" created
$ hugo mod init github.com/carpikes/yourproject
go: creating new go.mod: module github.com/carpikes/yourproject
go: to add module requirements and sums:
go mod tidy
$ hugo mod get github.com/willfaught/paige@latest
go: added github.com/willfaught/paige v0.80.2
$ cat >>hugo.toml <<EOF
[[module.imports]]
path = "github.com/willfaught/paige"
EOF
hugo server -D
Watching for changes in /tmp/yourproject/{archetypes,assets,content,data,i18n,layouts,static}
Watching for config changes in /tmp/yourproject/hugo.toml, /tmp/yourproject/go.mod
Start building sites …
hugo v0.127.0-74e0f3bd63c51f3c7a0f07a7c779eec9e922957e+extended linux/amd64 BuildDate=2024-06-05T10:27:59Z VendorInfo=gohugoio
Built in 553 ms
Error: error building site: render: failed to render pages: render of "home" failed: "/home/al/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/willfaught/paige@v0.80.2/layouts/_default/list.html:5:3": execute of template failed: template: _default/list.html:5:3: executing "main" at <partial "paige/pages.html" $page>: error calling partial: "/home/al/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/willfaught/paige@v0.80.2/layouts/partials/paige/pages.html:44:17": execute of template failed: template: partials/paige/pages.html:44:17: executing "partials/paige/pages.html" at <.ByWeight>: can't evaluate field ByWeight in type []interface {}
I'm using arch linux, and I've installed hugo-extended from AUR and dart-sass from the main repos.
$ hugo env
hugo v0.127.0-74e0f3bd63c51f3c7a0f07a7c779eec9e922957e+extended linux/amd64 BuildDate=2024-06-05T10:27:59Z VendorInfo=gohugoio
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.22.2"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"
github.com/sass/dart-sass/protocol="2.7.1"
github.com/sass/dart-sass/compiler=""
github.com/sass/dart-sass/implementation=""
Does anyone know why this is happening? Thanks!
willfaught commented
Thanks for your report! It should be fixed in v0.80.4. Does it work for you now?
Try:
cd yoursite
go get github.com/willfaught/paige@v0.80.4
hugo server -D
carpikes commented
It works now, thank you!