ERROR [en] REF_NOT_FOUND: Ref "new" from page "/books/new": page reference "new" is ambiguous.
I have tried changing the layout path to books/submit/new but that doesn’t work. I have had a look at the GitHub release notes, but I find them confusing. Any suggestions?
OK, I will still do the “one pager”, but the layout set in front matter has always meant to be a name and not a path (no slashes). The path inside /layouts is reserved for the Page path. I have only seen one case of this in “the wild” before. We may find a way to imrpove this, but I’m a little surprised that this actually worked in the old setup. Your current workaround would be to flatten your custom layouts, e.g. layouts/submit-new.html.
Ok, adding to the above, a better fix for you would be to just change to layout = new and layout = success. The layout lookup will search down the file path for the correct layout.
Also specific methods like templates.Current’s .Name value report “new” paths for these directories and add a digit at the end, even if old paths are used.
Thanks for helping out. I have tried your suggestion to do layout = new but I receive the same error message: ...page reference "new" is ambiguous
I should also add that @irkode comment is correct about the folder structure.
From reading between the lines, it seems I need to change my layout folder structure, but I’m uncertain as to how… I’ll await your page write up.
Feedback: it’s awesome to see so much growth and progress with Hugo. I have been using Hugo for many years now. At the same time, and I understand there are edge cases in how Hugo is used, but when changing what is perhaps a fundamental thing, perhaps the docs should be updated at the same time as the new changes are being rolled out?
And this is not just a comment on the template structure change. More often than not, imho, changes are made/new features are introduced, but aren’t documented, or perhaps not enough? I’ve been lucky in the past that these new changes have not impacted my project or were easy to implement, until now. For those wondering, I probably started using Hugo around v0.15-0.20.
This will treat ALL pages with the same layout. From the initial post I guessed there’s something like a default page layout for books and some special stuff for these submit pages…
that’s why I kept the layout parameter because there might be other stuff around.
yes, that is the intention, the new design synchronizes content and layout folder structures.
so the most specific template in the closest subfolder will win… and both @tyco 's generic one and my using front matter layout will work - unless there’s nothing special around in your repo.
Depending of the complexity of your layout structure ther’s nothing wrong with staying at v0.145 and wait for the docs.