Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build site after upgrading Hugo #11757

Closed
sankayop opened this issue Nov 28, 2023 · 6 comments · Fixed by #11771
Closed

Can't build site after upgrading Hugo #11757

sankayop opened this issue Nov 28, 2023 · 6 comments · Fixed by #11771

Comments

@sankayop
Copy link

What version of Hugo are you using (hugo version)?

$ hugo version
0.119.0-1

Does this issue reproduce with the latest release?

yes, I have also tried with the gohugo-extended-bin-0.120.4-1 but same error.

Error:

ERROR render of "page" failed: "/home/me/hugoProject/layouts/_default/baseof.html:3:9": execute of template failed: template: artists/single.html:3:9: executing "artists/single.html" at <partial "head.html" .>: error calling partial: "/home/me/hugoProject/layouts/partials/head.html:3:8": execute of template failed: template: partials/head.html:3:8: executing "partials/head.html" at <partial "schema" .>: error calling partial: execute of template failed: html/template:partials/schema.html: ends in a non-text context: {stateJSDqStr delimNone urlPartNone jsCtxRegexp attrNone elementScript }

Workaround:

downgrading package hugo (0.119.0-1 => 0.118.2-2)

@jmooring
Copy link
Member

jmooring commented Nov 28, 2023

@sankayop A reproducible example would be helpful.

Possible of duplicate of #11507, which might be resolved in Go 1.22 with https://go-review.googlesource.com/c/go/+/507995 (merged 2 Oct 2023).

@jmooring jmooring changed the title Can't compile after upgrading Hugo Can't build site after upgrading Hugo Nov 28, 2023
@sankayop
Copy link
Author

sankayop commented Nov 29, 2023

Hi @jmooring , I'm not using Hugo on a regular basis so it takes a bit of an effort to get the smallest case but.
Here's a howto to get the error from scratch:

hugo new site quickstart
cd quickstart
git init
cd themes
git clone https://github.com/appernetic/hugo-nederburg-theme.git
cd ..
rm -rf content layouts static hugo.toml
cp -r themes/hugo-nederburg-theme/exampleSite/* .

then remove following lines from following files:

themes/hugo-nederburg-theme/layouts/partials/head.html:25-28
themes/hugo-nederburg-theme/layouts/partials/category.html:4-9

then:

hugo server

and you get the site working with 0.118 but not with 0.119 and latest.

I hope it can help making Hugo better :)
btw, it looks indeed very similar to #11507

@bep bep removed the NeedsTriage label Nov 29, 2023
@bep bep added this to the v0.121.0 milestone Nov 29, 2023
@ytrepidorosonomous
Copy link

Your site has several errors and deprecated functions. Try this modified copy of your site https://filebin.net/eyok6f0unb4y5gkl. Pay attention to the schema.html file in particular. That's Hugo's recommended way of writing schema.

@sankayop
Copy link
Author

Thanks @dongorgan ,
I will transfer the info to the site builder (@appernetic :) ) and will also try to update the image I got for my website :)

Thanks for your review

@jmooring
Copy link
Member

jmooring commented Dec 1, 2023

The issue is simply reduced to:

<script>{ "a" b" }</script>

This is user error (missing quotation):

https://github.com/appernetic/hugo-nederburg-theme/blob/master/layouts/partials/schema.html#L24

Go's html/template package is doing the right thing.

@jmooring jmooring closed this as completed Dec 1, 2023
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants