1bl4z3r / hermit-V2

Continuing Hermit's legacy to be minimal and fast theme
https://1bl4z3r.github.io/hermit-V2/
MIT License
91 stars 38 forks source link

Can not build on hugo v0.120.x #38

Closed arongergely closed 11 months ago

arongergely commented 11 months ago

hugo v0.120.1 was rolled out yesterday and my Ubuntu snap package force-updated from v0.119.x.

Now I get the following errors when trying hugo serve:

ERROR render of "taxonomy" failed: "/home/aron/dev/rasterra/hermit-V2/layouts/_default/baseof.html:13:4": execute of template failed: template: _default/list.html:13:4: executing "_default/list.html" at <partial "structured-data.html" .>: error calling partial: execute of template failed: template: _internal/opengraph.html:47:9: executing "_internal/opengraph.html" at <site>: can't evaluate field facebook_admin in type []interface {}
Error: error building site: render: failed to render pages: render of "home" failed: "/home/aron/dev/rasterra/hermit-V2/layouts/_default/baseof.html:13:4": execute of template failed: template: index.html:13:4: executing "index.html" at <partial "structured-data.html" .>: error calling partial: execute of template failed: template: _internal/opengraph.html:47:9: executing "_internal/opengraph.html" at <site>: can't evaluate field facebook_admin in type []interface {}

The problem

in v0.120.0 they deprecated site.Social in favor of site.Params.social. Internal templates like _internal/opengraph.html are now looking for parameters there. (see https://github.com/gohugoio/hugo/commit/4910312ee75a1c67fad68c259ad9576dca854c62) This collides with the definition in theme's hugo.toml. (array of social media links)

Internal templates do not expect an array, so we get the error above.

Proposed solution

Probably to change [[params.social]] entries in hugo.toml to something else e.g. [[params.socialLinks]]. The site builds fine when I change or remove said entries.

1bl4z3r commented 11 months ago

Hi @arongergely,

That is the most breaking change, if I have ever seen one. I am checking new Hugo release and performing necessary changes.

Thank you for bringing this to my notice.

1bl4z3r commented 11 months ago

Thank you for the proposed solution. That was an easy fix. Your fix is pushed to main.

I have to now check if it will it break anything further down the line.

arongergely commented 11 months ago

Thanks a lot for the quick fix!

That is the most breaking change, if I have ever seen one.

Oh yeah. Rant incoming

  1. hugo's development is messy. It evolves in unexpected ways.
  2. snap packages force update and can not be rolled back. Hugo set up via snap is living on the edge

hugo + snap == pain Don't do it. :smile:

1bl4z3r commented 11 months ago

Ubuntu's over-dependence on snap is the only reason I don't daily drive it. That doesn't mean I don't use any packaging formats (I use Appimages and Flatpaks)

However, it is always better to have up-to-date packages (Not like Arch, btw). It might alleviate any sudden changes down the road. All thanks to you for living on the edge