luizdepra / hugo-coder

A minimalist blog theme for hugo.
MIT License
2.65k stars 1.05k forks source link

building failure about `mastodon.html` #904

Open zwyyy456 opened 2 months ago

zwyyy456 commented 2 months ago

Describe the problem:

Today, I update the hugo-coder theme and then run hugo serve, then I meet building failure.

My last hugo-coder theme is c340320a, it works well, and there is nomastodon.html in that version.

the log is as follows:

❯ hugo serve        
Watching for changes in /Users/zwyyy/code/blog/coder_blogs/{archetypes,assets,content,data,i18n,layouts,static,themes}
Watching for config changes in /Users/zwyyy/code/blog/coder_blogs/config.toml, /Users/zwyyy/code/blog/coder_blogs/themes/coder/config.toml
Start building sites … 
hugo v0.124.1-db083b05f16c945fec04f745f0ca8640560cf1ec+extended darwin/arm64 BuildDate=2024-03-20T11:40:10Z VendorInfo=brew

ERROR render of "page" failed: "/Users/zwyyy/code/blog/coder_blogs/themes/coder/layouts/posts/single.html:48:11": execute of template failed: template: posts/single.html:48:11: executing "content" at <partial "posts/mastodon.html" .>: error calling partial: "/Users/zwyyy/code/blog/coder_blogs/themes/coder/layouts/partials/posts/mastodon.html:4:91": execute of template failed: template: partials/posts/mastodon.html:4:91: executing "partials/posts/mastodon.html" at <.host>: can't evaluate field host in type bool
Built in 504 ms
Error: error building site: render: failed to render pages: render of "page" failed: "/Users/zwyyy/code/blog/coder_blogs/themes/coder/layouts/posts/single.html:48:11": execute of template failed: template: posts/single.html:48:11: executing "content" at <partial "posts/mastodon.html" .>: error calling partial: "/Users/zwyyy/code/blog/coder_blogs/themes/coder/layouts/partials/posts/mastodon.html:4:91": execute of template failed: template: partials/posts/mastodon.html:4:91: executing "partials/posts/mastodon.html" at <.host>: can't evaluate field host in type bool
zwyyy456 commented 2 months ago

it seems that commits 60fdc75 cause the building failure.

halon176 commented 2 days ago

same issue, hugo v0.128.0+extended linux/amd64

halon176 commented 2 days ago

update: in my case, same errore

Error: error building site: render: failed to render pages: render of "page" failed: "/home/halon/code/quickstart/themes/hugo-coder/layouts/posts/single.html:48:11": execute of template failed: template: posts/single.html:48:11: executing "content" at <partial "posts/mastodon.html" .>: error calling partial: "/home/halon/code/quickstart/themes/hugo-coder/layouts/partials/posts/mastodon.html:4:91": execute of template failed: template: partials/posts/mastodon.html:4:91: executing "partials/posts/mastodon.html" at <.host>: can't evaluate field host in type bool

It comes from the presence of the comments: true key in the header of some posts. Removing this key eliminates the error.