Hugo site generator users, be aware of a breaking change in v0.128.2.
I hadn't written a blog post in a while, and when I started preparing a new one using a current Hugo version (v0131.0), I suddenly got errors that did not seem to make sense to me, especially as they occurred on articles I hadn't changed for months or even years:
ERROR [en] REF_NOT_FOUND: Ref "/bintree": "/.../Blog/Hugo/content/post/big-o/index.md:66:65": page not found
ERROR [en] REF_NOT_FOUND: Ref "/balancedtree/": "/.../Blog/Hugo/content/post/big-o/index.md:66:108": page not found
ERROR [en] REF_NOT_FOUND: Ref "/flow/": "/.../Blog/Hugo/content/post/flow2go/index.md:25:24": page not found
...and a dozen more.
The pages obviously were there, so what had changed?
I have a permalink mapping in place that maps all articles that live in the content/post/ folder to the top level. That is, instead of /post/bintree, the article appears as /bintree on the site:
post = "/:filename/"
The cross-references I used were pointing to the published slug:
{{< ref "/bintree" >}})
This worked well until a change in v0.128.2 that disabled short lookups for paths with leading slash (apparently because these were considered a bug).
Thanks to the help of the generous Hugo community, I was finally able to pin down the cause of my issue to this change. (But it still had cost me a couple of hours of inspecting configs, building older Hugo releases to compare behavior, etc.)
To eliminate the errors, I changed all cross-references to include the /post/ prefix, like so:
{{< ref "/post/bintree" >}})
So, if you use permalinks configurations like the above to shorten the slug, AND if your cross-references point to the published slug rather than the internal content path, you now know how to fix the resulting errors.
#hugo #gohugo #gohugoio