Hugo does not build content in subdirectories

Hello everybody,

I installed Hugo and built my own theme - however, my pages below the first level are only generated by hugo server -w when they are created while the server is running.

My directory structure:

  • config.toml
  • theme/
  • content/
    • example/
      • www/
        • index.md (is generated)
        • contact.md (not generated)
        • about/
          • index.md (not generated)
      • docs/
        • index.md (is generated)
        • wiki/
          • index.md (not generated)
    • example2/
      • testsite.md (is generated)

My config.toml file:

languageCode = “en-us”
baseURL = “http://example.net
title = “My Title”
theme = “mycustomtheme”

[params]

The theme only contains a single html file inside _default/single.html and some partials. I enabled verbose and debug logging and the pages are not rendered - If I am recreating them, they are rendered and displayed properly, so it does not look like a theme problem to me.

I would be happy if someone could give me a hint.

Best Regards,

What does ‘recreating them’ mean? If you mean remove the page and make it anew, then I don’t get why the problem persists – just remove the page and make them anew to solve it. But it probably isn’t that simple :slight_smile:. So you probably mean something else with ‘recreating’.

Also, I supposed you double-checked that none of the posts are set to draft, or have a publication date that’s in the future?

Recreating means deleting the page and creating it again - unfortunately this does not solve the problem since this only helps until you restart hugo - the pages are also not built.

I am running hugo server -D --watch --verbose --debug to serve the pages - I don’t have neither draft nor a publication date set in the page title.

EDIT: I copied the same page which is generated and only renamed it before restarting Hugo - it is not build either so I don’t think that the page itself is the problem.

You need to read about bundles in the documentation.

Looks like renaming my index.md files to _index.md solved the problem, thank you very much!

1 Like