I’m working on a project I put on the back burner several Hugo versions ago. I’ve recently updated Hugo and resumed work but much of my existing layout is broken and silently failing without an error message.
Below is my IDE with relevant file tree on the left, broken layout file in the middle and Hugo server output on the right.
I’ve pinned most of my issues to .Render calls not working. I can tell the Range is still working properly as I can successfully output episode titles, the next call to .Render is either being ignored or silently failing.
Has there been changes to the way I should be calling .Render or addressing the file to use for the render? Do I need to make changes to my file structure?
Just to help clarify, the layout file is for a type “podcast”, a show. The items in the range are of type “episode”.
You now need to put all render layouts at the root of the layouts folder (also note the layouts changed in v0.146.0). See .Render is broken in v147.0 - #2 by bep
Thanks for your reply. Unfortunately, like the OP in your linked post, I was relying heavily on Render views so I could organize and keep related bits of code together.
I know the recommended “proper” fix is just dumping them all at the root of the layout folder and using naming conventions to try and organize the resulting mess. This is honestly a terrible solution IMHO.
I’ll be doing the same as the other OP and converting them to partials, where at least I can keep them organized.
Your reply did tell me how to get up and running again and I thank you very much for that.
Since only the OP and you have raised this issue in a year, it is safe to assume that your implementations were using an undocumented lookup order that worked before, but was rendered redundant when the lookup order became strict.
Also an error message instead of it just silently failing would be awesome, just saying.
That ship has already sailed. But naming conventions are actually good since you will be misusing partials for a role they are not intended for.