Hugo refuses to build pages in content folder

Good evening, everyone.
I’m having a real issue with getting started here with hugo. I’m a fairly new user with hugo and trying to get my site to work. I’ve got my homepage working well, with CSS and JS files. However when I go to make a new page, and try to navigate to it after running the server, it just gives me a 404 message. I’ve tried all the other tips i could find here and on stack overflow and nothing seems to work. I have a single.html and a lists.html template in the layouts folder, but it appears like it’s not recognizing the content. updated hugo to the latest version and reinstalled it. so far nothing helps. You can check out the code on github at GitHub - marcmartin-prog/Reeds_Creek I’d appreciate any help you can give. Really been giving me a headache.

You have an index.html: Reeds_Creek/index.html at main · marcmartin-prog/Reeds_Creek · GitHub

Try renaming this to _index.html, note the underscore.

1 Like

Thanks for the answer. But the index page is displaying as desired, it’s just the products and about pages that aren’t. Will renaming the index page make a difference with the other pages?

Thanks again. Tried that and it totally took care of the problem!

Have a read about Page Bundles: Page bundles | Hugo

TLDR:
index.* => no children pages;
_index.* => yes children pages.

Hi there - here’s what I’d recommend:

In the ‘contents’ directory, change the filename: index.html to _index.html (noting the preceding underscore), and then create directories named about and products.

Then rename …
content/about.html → to → content/about/index.html
and …
content/products.html → to → content/products/index.html

As you get more experienced, you’ll probably want to create templates to handle the different page layouts, but what you have is fine for now.

Best of luck!

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