-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Table hook renderer not found when html output format has a zero weight and another output format has a non-zero weight #13351
Comments
A bit more context, when I comment out the tables in my markdown, the default template works. When modifying the template locally, it doesn't matter if I try to use When following this: https://gohugo.io/render-hooks/tables/ The only temp fix is to comment or remove line 55. |
I'm not sure what that means. It would be helpful if you could provide a reproducible example (e.g., a repository). |
@jmooring it is in a private repo, I will work up an example file with the failing condition in it and I will post it here. I also corrected the typo in the original bug report above. |
I am unable to reproduce the problem as described:
So there's obviously something different about your site. |
@gwagner Are you able to provide a reproducible example? |
I'm experiencing the same thing, but mine is occurring in my json index templates trying to parse .Summary still trying to pare down to a minimum reproducible set to see if I can isolate what's up. There's certainly AN issue.... but it's cause isn't immediately obvious Like the OP, I first attempted to add the unfindable template. I tried adding it as After reverting my uses of
140.x: DEBUG Write redirect to main language en: https://example.com/
INFO build: step render substep pages site en outputFormat manifest duration 199.887964ms
INFO build: step render substep pages site en outputFormat html duration 7.253810566s
INFO build: step render substep pages site en outputFormat json duration 476.465042ms
INFO build: step render substep pages site en outputFormat rss duration 27.599815ms
WARN found no layout file for "sitemap" for kind "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN found no layout file for "sitemap" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN found no layout file for "sitemap" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN found no layout file for "sitemap" for layout "simple" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
INFO build: step render substep pages site en outputFormat sitemap duration 3.903785ms
INFO build: step render substep pages site brk outputFormat manifest duration 72.549489ms
INFO build: step render substep pages site brk outputFormat html duration 7.973025596s
INFO build: step render substep pages site brk outputFormat json duration 476.125711ms
INFO build: step render substep pages site brk outputFormat rss duration 18.75689ms
INFO build: step render substep pages site brk outputFormat sitemap duration 2.58434ms
INFO build: step render pages 1077 content 716 duration 16.509561681s
INFO build: step render deferred count 0 duration 225.531µs
INFO build: step postProcess duration 11.677µs 141.x
I see no mention in the 141 run of the alternate language my site uses but I think it's dying before it gets to that. I suspect that some breaking config restructuring or something occurred between 140 and 141 ... sigh |
As mentioned above, I am unable to reproduce this problem with the test repo above. It would helpful if someone were able to share a repository. |
https://gitlab.wolfspyre.io/wolfspyrelabs/open/blogsite does manifest the problem. I'm sure there's a plethora of things I'm doing horrifically wrong here that could be related/adjacent .. :) |
The error is triggered when (a) the I have not verified this, but I suspect this is unintentional side effect of #13263. Failing test case: func TestIssue13351(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
disableKinds = ['page','rss','section','sitemap','taxonomy','term']
[outputs]
home = ['html','json']
[outputFormats.html]
weight = 1
[outputFormats.json]
weight = 2
-- content/_index.md --
---
title: home
---
a|b
:--|:--
1|2
-- layouts/index.html --
{{ .Content }}
-- layouts/index.json --
{{ .Content }}
`
b := hugolib.Test(t, files)
b.AssertFileContent("public/index.html", "<table>") // pass
b.AssertFileContent("public/index.json", "<table>") // pass
files = strings.ReplaceAll(files, "weight = 1", "weight = 0")
b = hugolib.Test(t, files)
b.AssertFileContent("public/index.html", "<table>") // fail: error calling Content: table hook renderer not found
b.AssertFileContent("public/index.json", "<table>")
} There may be variations on this, but the above was the simplest example I could contrive. |
Your knowledge of the innards of Hugo never cease to amaze me. I appreciate your skill, and am sincerely appreciative for the energy you consistently contribute to the project.. |
I can confirm that ensuring that all outputformats specified in the site config have a weight associated with them that is greater than 1 seems to resolve the issue I was experiencing. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes
When I try to build my hugo project, if there is a valid table in a markdown file, the default rss.xml template pukes at this line.
The error i receive is:
When I add the template locally to /themes//layouts/_default/rss.xml and comment out line 55 (linked above), the build works perfectly fine.
I am happy to provide any relevant config information, but I do not have anything special in the config. I am using the default Goldmark Markdown Renderer.
The text was updated successfully, but these errors were encountered: