"ref" and "relref" failing when trying to link to peer documents

What version of Hugo are you using (hugo version)?

$ hugo version hugo v0.110.0-e32a493b7826d02763c3b79623952e625402b168 windows/amd64 BuildDate=2023-01-17T12:16:09Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

Yes

Problem description

I have been unsuccessful using “ref” and “relref” in my *.md files.
It always produces the following errors within the web page:

[en] REF_NOT_FOUND: Ref “tester”: “C:\Users\nettl\projects\quickstart\content\english\pages\contributions\index.md:13:24”: page not found
[en] REF_NOT_FOUND: “C:\Users\nettl\projects\quickstart\content\english\pages\contributions\index.md:14:24”: page not found logged 2 error(s)

hugo v0.110.0-e32a493b7826d02763c3b79623952e625402b168 windows/amd64 BuildDate=2023-01-17T12:16:09Z VendorInfo=gohugoio

Reload Page

The lines in the *.md file causing the errors are as follows:

  • [tester page TEST 1]({{< relref “tester” >}})
  • [tester page TEST 2]({{< ref “tester” >}})

In this case “tester” is a directory that contains an index.md file.

This has been happening since 0.109.0… so I upgraded to 0.110.0 with the hope that this has been resolved.

Sadly, the problem persists.

Any help or inights are appreciated.

Thank you.

With this structure:

content/
├── tester/
│   └── index.md
└── _index.md      <-- home page

And this markdown on the home page:

[tester page TEST 1]({{< relref "tester" >}})

[tester page TEST 2]({{< ref "tester" >}})

The links work as expected.

In the front matter of content/tester/index.md

  • Do you have draft set to true?
  • Is the date or publishDate in the future?
  • Is the expiryDate in the past?

Thank you for your response!

I will give my answers below.

The structure that I have looks like the following:

content/english/pages/contributions/
├── tester/
│   └── index.md
└── index.md

With the following inside of content/english/pages/contributions/ /index.md:

* [tester page TEST 1]({{< relref "tester" >}})
* [tester page TEST 2]({{< ref "tester" >}})

In my case the tester/index.md never generates the appropriate index.html.

content/tester/index.md

  • Do you have draft set to true? No.
  • Is the date or publishDate in the future? No
  • Is the expiryDate in the past? No

This above is what I have so far.

If this is your structure:

content/
├── english/
│   └── pages/
│       └── contributions/
│           ├── tester/
│           │   └── index.md
│           └── index.md      <-- This must be _index.md; it is a section
└── _index.md

Ah! Thank you, I see now.

I’ll try to fix the structure.

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