jpanther / congo

A powerful, lightweight theme for Hugo built with Tailwind CSS.
https://jpanther.github.io/congo/
MIT License
1.19k stars 318 forks source link

Error calling first: can't iterate over maps.Params #834

Closed krischik closed 4 months ago

krischik commented 6 months ago

Issue description

All my old sites started to throw errors messages even true I did not make any changes apart from updating the theme. I guess something changed. But what? Yes, I have seen the warning but I was waiting for the you to fix that.

Those did not improve the situation.

Since you always ask: https://git.code.sf.net/p/tutorial-6502/code, branch develop, directory Documents.

Theme version

v2.8.1

Hugo version

hugo v0.122.0-b9a03bd59d5f71a529acb3e33f995e0ef332b3aa+extended darwin/amd64 BuildDate=2024-01-26T15:54:24Z VendorInfo=brew

Which browser rendering engines are you seeing the problem on?

Chromium (Google Chrome, Microsoft Edge, Brave, Vivaldi, Opera, etc.)

URL to sample repository or website

https://git.code.sf.net/p/tutorial-6502/code

Hugo output or build error messages

hugo server 
Watching for changes in /Users/Shared/Work/Projects/6502Tutorial/Documents/{archetypes,assets,content,data,layouts,static,themes}
Watching for config changes in /Users/Shared/Work/Projects/6502Tutorial/Documents/hugo.toml, /Users/Shared/Work/Projects/6502Tutorial/Documents/themes/congo/config/_default, /Users/Shared/Work/Projects/6502Tutorial/Documents/go.mod
Start building sites … 
hugo v0.122.0-b9a03bd59d5f71a529acb3e33f995e0ef332b3aa+extended darwin/amd64 BuildDate=2024-01-26T15:54:24Z VendorInfo=brew

WARN  [CONGO] Theme parameter `author` block in `languages.xx.toml` has been renamed to `params.author`. Please update your site configuration.
ERROR render of "page" failed: "/Users/Shared/Work/Projects/6502Tutorial/Documents/themes/congo/layouts/_default/baseof.html:11:6": execute of template failed: template: _default/single.html:11:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: template: _internal/opengraph.html:6:15: executing "_internal/opengraph.html" at <partial "_funcs/get-page-images" .>: error calling partial: execute of template failed: template: partials/_funcs/get-page-images.html:18:21: executing "partials/_funcs/get-page-images.html" at <first 1 .>: error calling first: can't iterate over maps.Params
Built in 148 ms
Error: error building site: render: failed to render pages: render of "page" failed: "/Users/Shared/Work/Projects/6502Tutorial/Documents/themes/congo/layouts/_default/baseof.html:11:6": execute of template failed: template: _default/single.html:11:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: template: _internal/opengraph.html:6:15: executing "_internal/opengraph.html" at <partial "_funcs/get-page-images" .>: error calling partial: execute of template failed: template: partials/_funcs/get-page-images.html:18:21: executing "partials/_funcs/get-page-images.html" at <first 1 .>: error calling first: can't iterate over maps.Params
make: *** [run-hugo] Error 1
jpanther commented 6 months ago

I couldn't get your sample repo to open. Have you tried renaming the author block to params.authors? That seems to be the error that is being output in the snippet you provided.

krischik commented 6 months ago

Problem was solved: https://discourse.gohugo.io/t/error-calling-first-cant-iterate-over-maps-params/48907/8

I couldn't get your sample repo to open. Have you tried renaming the author block to params.authors? That seems to be the error that is being output in the snippet you provided.

Yes, but that was some time ago. Back then it didn't work as congo hasn't migrated back then and I had to revert again as it's only a warning. Has congo been updated on the stable branch?

jpanther commented 6 months ago

The stable branch always reflects the latest release so it is currently at v2.8.1