Junyi-99 / hugo-theme-anubis2

Anubis2 is a simple but elegant theme for Hugo blog engine
https://hugo-theme-anubis2.netlify.app/
MIT License
52 stars 16 forks source link

Anubis2 doesn't work with recent release of Hugo #81

Closed M1ndo closed 1 day ago

M1ndo commented 1 day ago

Anubis (Deprecated) and anubis2 both are unable to build on the latest release of hugo

WARN  deprecated: site config key paginate was deprecated in Hugo v0.128.0 and will be removed in a future release. Use pagination.pagerSize instead.
Start building sites …
hugo v0.139.0+extended linux/amd64 BuildDate=unknown

ERROR render of "404" failed: "/home/ybenel/../blog_ybenel/themes/anubis2/layouts/_default/baseof.html:24:15": execute of template failed: template: 404.html:24:15: executing "footer" at <partial "footer.html" .>: error calling partial: "/home/ybenel/../blog_ybenel/themes/anubis2/layouts/partials/footer.html:18:21": execute of template failed: template: partials/footer.html:18:21: executing "partials/footer.html" at <site>: can't evaluate field name in type string
ERROR render of "page" failed: "/home/ybenel/../blog_ybenel/themes/anubis2/layouts/_default/baseof.html:24:15": execute of template failed: template: _default/single.html:24:15: executing "footer" at <partial "footer.html" .>: error calling partial: "/home/ybenel/../blog_ybenel/themes/anubis2/layouts/partials/footer.html:18:21": execute of template failed: template: partials/footer.html:18:21: executing "partials/footer.html" at <site>: can't evaluate field name in type string
Total in 717 ms
Error: error building site: render: failed to render pages: render of "page" failed: "/home/ybenel/../blog_ybenel/themes/anubis2/layouts/_default/baseof.html:24:15": execute of template failed: template: _default/single.html:24:15: executing "footer" at <partial "footer.html" .>: error calling partial: "/home/ybenel/../blog_ybenel/themes/anubis2/layouts/partials/footer.html:18:21": execute of template failed: template: partials/footer.html:18:21: executing "partials/footer.html" at <site>: can't evaluate field name in type string
Junyi-99 commented 1 day ago

Haha, I'm using hugo v0.136.5+extended darwin/arm64 BuildDate=2024-10-24T12:26:27Z VendorInfo=brew, and I didn't encounter this error.

I will investigate why version hugo v0.139.0+extended linux/amd64 BuildDate=unknown is reporting this issue.

M1ndo commented 1 day ago

@Junyi-99 Very strange, when switching back from Anubis to Anubis2, while the configuration hasn't changed much at all. It fails and its valid. having [menu] set, will cause the build to fail. The debugging output wasn't useful, but hopefully someone might came across this issue in the future and get it fixed. Thanks for maintaining this theme, Cheers!

Junyi-99 commented 1 day ago

Hi @M1ndo , could you share your hugo.toml or hugo.yaml configuration file? It seems the issue might be related to the user's config.

I came across a potential solution you might find helpful: https://git.deuxfleurs.fr/GuerillaStudio/now-playing/commit/4c9272b4c8c241b24912c291959430e211b47ef9

(By the way, Hugo often changes its config file format and tends to have limited backward compatibility.)

Thanks for using Anubis2 and sharing your feedback!

M1ndo commented 18 hours ago

@Junyi-99 Sure, here's the old and the newest config.

Turns out the issue was from

[params]
author = "A"
# It should be 
[params.author]
name = "A"
# also 
[author]
name = "A" # Also worked.