-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
link: make resolution reporting configurable #774
Comments
Kind of a moving target, but this was just posted the minute: https://discourse.gohugo.io/t/did-relref-semantics-change/48306/8 I have to take al look into it. The themes render hook gets the link somehow from the ref/relref shortcode. There seems to be some resultion that doesn't work well with the render hook (although the render hook is resembling Hugo's standard handling as of verison 0.123.0). |
Hmmm, this came up after upgrading the relearn theme (same Hugo version before and after the theme update), so I've been looking for changes in behaviour. |
What I wanted to say is that there are also changes in Hugo on the horizion, that will affect the link resolution. But I will take a look into it. It was not intended to break former behavior with the version 5.24.0. |
Yeah, maybe I've been using this not the intended way ... |
I reproduced it in the theme's exampleSite. This happens only if The warning is generated by the theme - not by Hugo. In the previous version, the code had the same issue but no warning was emitted but the implementation caused other side effects (#748). So with this release, the resolution was aligned to way the upcoming 0.123.0 version of Hugo is doing this. In both the old and the new implementation, the unresolved link is written as-is into the resulting page as a way to not fail the build. So while the resolution could not find the page, In case of |
@andi-blafasl This change turns off the console message for unresolved links by default. If you want them back, you have to explicitly set this in your |
@McShelby thx for your swift response! indeed, i have to use to understand this better from a users perspective: the way i'm using this feature is not quite supported/intended by the theme, but hugo makes it work in the end? should i switch to |
The way it works is:
Luckily, the theme does not make any assumptions besides the warning. All magic happens in Hugo's So your usage relies on Hugo doing the magic in it's shortcode. A plain markdown link will not do this kind of lookup and most likely will generate a invalid link. The output results are the same if you delete the theme's render_hook. So: No magic by the theme, here.
That depends on your usage of the rel/relref shortcode. But from what you are saying, I would expect problems. |
oh well, that's sad news. indeed i'm relying on hugos magic in |
@McShelby happy to report, with v5.24.1 everything is back to normal in my workflow! thx 🙏 |
@McShelby Hugo v0.123.0 plus Relearn v5.24.1 seems to be working like a charm in my setup - so |
Yeah, 0.123.0 came out quicker than I had expected. |
After upgrading to 5.24.0 I'm getting errors when using
relref
.temp
is the document root (--contentDir temp
). Intemp/_index.md
there is a line[File A]({{% relref "file-a" %}})
. Up to and including 5.23.2 this used to find/file_a.html
via/file_a/_index.md
.In 5.24.0 I'm getting errors:
Hugo seems to locate the file just fine, but complains that it cannot be found?
When I change the
relref
to justref
, everything seems to work like before. Am I missing something? I would like to link to files and only want to specify the unique file name (since I don't know the exact path at this point - don't ask ;).Using Hugo v0.122.0.
Edit: When just using
{{% relref "file-a" %}}
(i.e. not including this in a Markdown link), this works still fine and evaluates to/file-a.html
(as expected).Edit: It actually works also in a Markdown link, i.e. the
relref
link will be resolved correctly. But Hugo keeps complaining.The text was updated successfully, but these errors were encountered: