gethinode / hinode

A clean documentation and blog theme for your Hugo site based on Bootstrap 5
https://gethinode.com
MIT License
146 stars 50 forks source link

[BUG] Error while running pristine site with hugo v0.123.8 #834

Closed deining closed 7 months ago

deining commented 7 months ago

How to reproduce

Create a new site, as specified in README.md:

hugo new site my-hinode-site && cd my-hinode-site
hugo mod init example.com/my-hinode-site
echo "[[module.imports]]" >> hugo.toml
echo "path = 'github.com/gethinode/hinode'" >> hugo.toml
hugo server

Now when using latest hugo version v0.123.8, this results in an error for me:

go: no module dependencies to download
hugo: downloading modules …
go: downloading github.com/gethinode/hinode v0.22.5
go: added github.com/gethinode/hinode v0.22.5
hugo: collected modules in 51185 ms
Watching for changes in /tmp/my-hinode-site/{archetypes,assets,content,data,i18n,layouts,static}
Watching for config changes in /tmp/my-hinode-site/hugo.toml, /tmp/my-hinode-site/go.mod
Start building sites … 
hugo v0.123.8-5fed9c591b694f314e5939548e11cc3dcb79a79c+extended linux/amd64 BuildDate=2024-03-07T13:14:42Z VendorInfo=gohugoio

ERROR render of "taxonomy" failed: execute of template failed: template: partials/head/head.html:6:7: executing "head" at <partialCached "head/stylesheet-core.html" .>: error calling partialCached: "/home/andreas/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gethinode/hinode@v0.22.5/layouts/partials/head/stylesheet-core.html:3:3": execute of template failed: template: partials/head/stylesheet-core.html:3:3: executing "partials/head/stylesheet-core.html" at <partial "head/stylesheet.html">: error calling partial: "/home/andreas/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gethinode/hinode@v0.22.5/layouts/partials/head/stylesheet.html:57:12": execute of template failed: template: partials/head/stylesheet.html:57:12: executing "partials/head/stylesheet.html" at <partial "head/icons.html" (dict "css" $css)>: error calling partial: "/home/andreas/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gethinode/hinode@v0.22.5/layouts/partials/head/icons.html:39:51": execute of template failed: template: partials/head/icons.html:39:51: executing "partials/head/icons.html" at <resources.ExecuteAsTemplate>: error calling ExecuteAsTemplate: type <nil> not supported in Resource transformations
ERROR render of "404" failed: execute of template failed: template: partials/head/head.html:6:7: executing "head" at <partialCached "head/stylesheet-core.html" .>: error calling partialCached: "/home/andreas/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gethinode/hinode@v0.22.5/layouts/partials/head/stylesheet-core.html:3:3": execute of template failed: template: partials/head/stylesheet-core.html:3:3: executing "partials/head/stylesheet-core.html" at <partial "head/stylesheet.html">: error calling partial: "/home/andreas/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gethinode/hinode@v0.22.5/layouts/partials/head/stylesheet.html:57:12": execute of template failed: template: partials/head/stylesheet.html:57:12: executing "partials/head/stylesheet.html" at <partial "head/icons.html" (dict "css" $css)>: error calling partial: "/home/andreas/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gethinode/hinode@v0.22.5/layouts/partials/head/icons.html:39:51": execute of template failed: template: partials/head/icons.html:39:51: executing "partials/head/icons.html" at <resources.ExecuteAsTemplate>: error calling ExecuteAsTemplate: type <nil> not supported in Resource transformations
Built in 569 ms
Error: error building site: render: failed to render pages: render of "home" failed: execute of template failed: template: partials/head/head.html:6:7: executing "head" at <partialCached "head/stylesheet-core.html" .>: error calling partialCached: "/home/andreas/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gethinode/hinode@v0.22.5/layouts/partials/head/stylesheet-core.html:3:3": execute of template failed: template: partials/head/stylesheet-core.html:3:3: executing "partials/head/stylesheet-core.html" at <partial "head/stylesheet.html">: error calling partial: "/home/andreas/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gethinode/hinode@v0.22.5/layouts/partials/head/stylesheet.html:57:12": execute of template failed: template: partials/head/stylesheet.html:57:12: executing "partials/head/stylesheet.html" at <partial "head/icons.html" (dict "css" $css)>: error calling partial: "/home/andreas/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gethinode/hinode@v0.22.5/layouts/partials/head/icons.html:39:51": execute of template failed: template: partials/head/icons.html:39:51: executing "partials/head/icons.html" at <resources.ExecuteAsTemplate>: error calling ExecuteAsTemplate: type <nil> not supported in Resource transformations

I can run the same site fine with hugo v0.122.0, however.

markdumay commented 7 months ago

It appears Hugo has changed its resource handling in v0.123.8. I submitted a change to the Hinode repo to avoid the handling of nil resources. However, this has an unwanted side effect, as the Bootstrap icons no longer seem to render correctly (see #832).

I'll see if there's anything else I can do on my side, or that I need to raise an issue in the Hugo repo.

markdumay commented 7 months ago

I've released Hinode v0.23.0-rc.4 which should solve the issues.