athul / archie

A minimal Hugo Theme
https://athul.github.io/archie
MIT License
977 stars 299 forks source link

Fix compatibility with Hugo v0.125.0 #108

Closed 0ge closed 4 months ago

0ge commented 4 months ago

google_analytics_async.html is now removed from Hugo and the regular template should be used. Hugo pull-request: #12299

Without this change, it is not possible to build with Hugo v0.125.0 or later.

0ge commented 4 months ago

When trying to run this with Hugo v0.125.0 I got following errors. Using the non-async template fixes the issue, as it now appears to have been deprecated.

I don't know how this affects backwards compatibility. (I.e. Hugo < 0.125.0)

❯ hugo server
Watching for changes in <project dir>/{archetypes,assets,content,data,i18n,layouts,static,themes}
Watching for config changes in <project dir>/hugo.toml
Start building sites …
hugo v0.125.0-a32400b5f4e704daf7de19f44584baf77a4501ab+extended darwin/arm64 BuildDate=2024-04-16T15:04:41Z VendorInfo=brew

ERROR render of "taxonomy" failed: "<project dir>/themes/archie/layouts/_default/baseof.html:8:12": execute of template failed: template: _default/terms.html:8:12: executing "_default/terms.html" at <partial "footer.html" .>: error calling partial: execute of template failed: html/template:partials/footer.html:14:12: no such template "_internal/google_analytics_sync.html"
ERROR render of "home" failed: "<project dir>/themes/archie/layouts/index.html:26:6": execute of template failed: template: index.html:26:6: executing "index.html" at <partial "footer.html" .>: error calling partial: execute of template failed: html/template:partials/footer.html:14:12: no such template "_internal/google_analytics_sync.html"
Built in 11 ms
Error: error building site: render: failed to render pages: render of "section" failed: "<project dir>/themes/archie/layouts/_default/baseof.html:8:12": execute of template failed: template: _default/list.html:8:12: executing "_default/list.html" at <partial "footer.html" .>: error calling partial: execute of template failed: html/template:partials/footer.html:14:12: no such template "_internal/google_analytics_sync.html"
athul commented 4 months ago

@0ge Maybe can you update the readme to let them know if there is a breakage and how to fix it?

0ge commented 4 months ago

Sounds reasonable! I’ll push an update.

Since the template exists in the earlier versions, I guess it would successfully publish, but I don’t know how the two differs. I’m new to Hugo (since Thursday) and don’t use GA so I can unfortunately not evaluate how it would affect sites.