Development Environment - Reference Links Break site

Hello, this one has had me stumped for a while and I’m not sure what I am doing wrong.

I’ve tried to generate a hugo site twice with the current version, hugo v0.110.0+extended linux/amd64, but cannot get reference links to work while developing my blog. It has some pagination to go into the different topics I cover.

I have a dir for each topic within the contents dir.
Within each dir is an unique index.md file - this is where I place the links to each document within the topic’s dir.

I first generate a new document with hugo using hugo new /content/topic/first_post.md

I type up some text and set the draft tag to false.

I update the index.md file within the dir to include a link to the new document, adding line:
[first post]({{< ref “/topic/first_post.md” > }})

This breaks the site immediately and produces the REF_NOT_FOUND error.

It does not matter if I use relref or ref.

It does not matter if I build a new hugo site - the bug persists.

I have confirmed permissions to the files index.md and first_post.md are consistent.

The link works when I drop the markdown document and just provide a path - of course this never lets me open the intended document.

I cannot seem to find where/how I am doing this one wrong.

It sounds like you have this file structure:

content/
└── topic-1/
    ├── document-1.md
    ├── document-2.md
    └── index.md

Is that correct?

Yup, that’s exactly what I am going for.

You need to rename “index.md” to “_index.md”.

1 Like

That solved it, thanks.

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