Why can't I access second level content folder files with my single.html template?

When I add

content/
     -page-1/
          -page-2.md

My single.html template renders the page. But when I add:

content/
     - page-1/
           -page-2/
                 - _index.md

In this case, Hugo renders my list template on /page-1/page-2/ URL.

I need my URL to be /page-1/page-2/ or sometimes even /page-1/page-2/page-3/.
How can I achieve it? How can I create single.html file for content that is in the 2nd or 3rd subfolder?

I tried creating layouts/page-1/page-2/single.html, but this doesn’t work for me, again list template is rendered.

Thank you for your help upfront!

Of course. _index.md triggers list, index.md triggers single. See the documentation for the difference between leaf and branch bundles.

1 Like

Thank you very much, I was struggling for hours

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