HUGO

REF_NOT_FOUND: Ref doesn't work

I have a project with this structure in content:

index.md
- courses
- - hoon-101
- - - 1-the-bare-naked-generator.md

in index.md I put this: [Lesson 1]({{< ref “courses/hoon-101/1-the-bare-naked-generator.md” >}})

and I get REF_NOT_FOUND: Ref “courses/hoon-101/1-the-bare-naked-generator.md” when I run hugo server

What gives, mate? I must be missing something obvious.

Is this a typo and did you mean _index.md? If not, then that is your problem. Have a read about Page Bundles: https://gohugo.io/content-management/page-bundles/

Basically, everything below it is a Page Resource, not an actual Page.

No, it’s just index.md. Updating the OP with better formatting

You need _index.md in there, not index.md. This makes the sub-pages proper Pages, not Page Resources.

Even with content structure:

_index.md
- courses
- - hoon-101
- - - 1-the-bare-naked-generator.md

I get the same error. is there another file to add?

Easier to help if we can see your code: Requesting Help

Is the page you are referencing draft: true?

You’ve got it. I really appreciate it.

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