Nested page not found by ref function

Hello everyone, I’m back with another question that is puzzling my mind right now.
I have this situation in my content folder:

content/
    ├── _index.md
    ├── articles/
    │       ├── [...]
    │       ├── various.md
    │       └── articles.md
    └── is/
        ├── index.md
        └── legal/
            └── index.md

And in the theme I’m developing, I can access is/index.md as localhost:1313/is/ without any problems, but for some reason which I can’t comprehend, legal/index.md, which I should be able to access as localhost:1313/is/legal/ returns the REF_NOT_FOUND error and I can’t access it.

Do you have any ideas or pointers as to where I could look to solve this issue?

Thanks a lot in advance
cheers.

Rename is/index.md to is/_index.md.

thanks for your reply, it’s a step forward, but still the problem is now that I can access /is/legal while /is/ returns a 404.

the content directory is now like this:

content/
    ├── _index.md
    ├── articles/
    │       ├── [...]
    │       ├── various.md
    │       └── articles.md
    └── is/
        ├── _index.md
        └── legal/
            └── index.md

but I’ve also noticed that in my sitemap.xml the pages are showing correctly, and hugo server doesn’t complain about any errors while rebuilding the site.

Any ideas?
Thanks.

Please share a link to the public repository for your project.

See https://discourse.gohugo.io/t/requesting-help/9132.

Let us see your code

Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.

If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

Hello everyone, sorry for the delayed reply.

here’s a github repository of the theme.
These are the steps I used to replicate the issue:

cd /tmp
hugo new site danixland
cd danixland/themes
git clone https://github.com/danixland/temp-theme-danixland.git danixland
cd ..
echo "theme: 'danixland'" >> config.toml
hugo new _index.md
hugo new is/_index.md
hugo new is/legal/index.md

Then I edited those 3 pages I created to have some content in them and removed the draft statement in the front matter.
In the sitemap.xml the pages are listed correctly but when I navigate to them it returns a 404

Thanks again for your help
Cheers

These templates are empty:

1 Like

thanks a lot, I was missing the list template and the branch bundle required that in order to be displayed.

Cheers

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