Hugo 0.123.0 breaks some usages of the relref shortcode

After having upgraded to 0.123.0 and now 0.123.1 and some relref short codes don’t work anymore.

Specifically the following seem to break:

  • {{< ref path="/posts/" outputFormat="rss" >}} (but {{< ref path="/" outputFormat="rss" >}} works)
  • Relative paths to parents also don’t work anymore: {{< relref "../2024-01-15 Navigating the tech maze" >}} (there is an file in that folder).

Might be related:

Here’s a minimal example that shows the problem:

As a temporary fix it works to append a / at the end, even if there is no file there.

One of the intentional breaking changes in v0.123.0 is the introduction and usage of a logical path.

There’s a detailed explanation of how this change affects relative paths here:

I recommend reading more about logical paths here:

Specifically, the difference between a file tree and a logical tree:

I’ll have a look at your {{< ref path="/posts/" outputFormat="rss" >}} issue later today, which you’ve also posted here:

Looking at the test repository you provided…

  • In content/posts/post-3/ change “…/post-2/” to “post-2”. This is the logical path as I described in my previous comment.
  • The problem with {{< relref path="/posts/" outputFormat="rss" >}} in content/posts/post-2/ will be addressed with:

Thank you very much, that was super quick.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.