hugo-sid / hugo-blog-awesome

Fast, minimal blog with dark mode support.
https://hba.sid.one
MIT License
396 stars 153 forks source link

Paginator error #174

Closed deining closed 6 months ago

deining commented 6 months ago

Describe the bug

This issue is closely related to #170. I doubt whether the issue addressed there is fully resolved.

Steps to reproduce Steps to reproduce the behavior:

git clone --single-branch -b hugo-module https://github.com/deining/hugo-blog-awesome
cd hugo-blog-awesome/exampleSite
hugo server

Site runs fine with hugo v0.122.0, but not with hugo v0.123.7

Expected behavior Site should run fine both with hugo v0.122.0 and hugo v0.123.7

The issue can also be seen here.

MichielVanDerWinden commented 6 months ago

The go.sum for the exampleSite in your branch is set to

github.com/hugo-sid/hugo-blog-awesome v1.13.0 h1:Jy22y4EVbZDzKnwSl0bN7dyaMlvGEZZT8KV+/VIx0vE=
github.com/hugo-sid/hugo-blog-awesome v1.13.0/go.mod h1:oRoqH9/bJDdyQqBoxI77O1oWAwVtn+fTng9MD3vR8A0=

That's the old release that doesn't contain the fix yet.

If you look at this repo's setup you'll see it doesn't contain a go.sum and thus doesn't download a specific version of the hugo-blog-awesome repo but instead uses the one you appoint by running hugo server --themesDir ../.. as shown in the README.MD.

@hugo-sid I think you'll need to create a new release to fix this when using your template as a module.

hugo-sid commented 6 months ago

@deining thanks for opening this issue. I agree with the points raised by @MichielVanDerWinden.

Going further, from the Netlify log, it can be seen that modules/pkg/mod/github.com/hugo-sid/hugo-blog-awesome@v1.13.0 is used, which doesn't contain the fix yet.

6:20:58 PM: hugo v0.123.7-312735366b20d64bd61bff8627f593749f86c964+extended linux/amd64 BuildDate=2024-03-01T16:16:06Z VendorInfo=gohugoio
6:20:58 PM: ERROR render of "page" failed: "/opt/build/cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugo-sid/hugo-blog-awesome@v1.13.0/layouts/_default/baseof.html:3:8": execute of template failed: template: _default/single.html:3:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/opt/build/cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugo-sid/hugo-blog-awesome@v1.13.0/layouts/partials/head.html:2:8": execute of template failed: template: partials/head.html:2:8: executing "partials/head.html" at <partial "meta/main.html" .>: error calling partial: "/opt/build/cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugo-sid/hugo-blog-awesome@v1.13.0/layouts/partials/meta/main.html:2:3": execute of template failed: template: partials/meta/main.html:2:3: executing "partials/meta/main.html" at <partial "meta/post.html" .>: error calling partial: "/opt/build/cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugo-sid/hugo-blog-awesome@v1.13.0/layouts/partials/meta/post.html:5:21": execute of template failed: template: partials/meta/post.html:5:21: executing "partials/meta/post.html" at <.Paginate>: error calling Paginate: pagination not supported for this page: kind: "page", path: "/posts/placeholder-text", file: "/opt/build/repo/exampleSite/content/en/posts/placeholder-text/index.md"

But @deining, this issue has taught me that I should release updates more frequently 😄 This way, users of this theme who rely on Hugo modules for updates can receive them ASAP.

@hugo-sid I think you'll need to create a new release to fix this when using your template as a module.

@MichielVanDerWinden you are right. I will create a release ASAP.

deining commented 6 months ago

Sorry for the noise, my bad! You are right that my go.mod points to an older version that does not contain the fix. Changed my PR already to point to HEAD of repo, everything is fine now! Looking forward to see a new release soon!