Is there a way to generate hugo files without index.html?

1.3k Views Asked by At

I have my static website in hugo, this is the folder structure:

Hugo static site init structure

I do not why, when I do hugo -D to build hugo, it generates the following scaffolding:

Scaffolding Image generated by Hugo

I just want pricing, terms and privicy page in the root folder after building hugo, with their respective names, not a folder with the name and inside an index.html file.

NOTE: pricing, terms and privacy page are using single.html

1

There are 1 best solutions below

0
On

Hugo defaults to using pretty links, that is to say ending with a trailing slash and no extenstion. That is what you are seeing output, hugo creates an index file in its own directory.

This means you don't get URLs like example.com/pricing.html, which is generally what people prefer.

If you would prefer a flatter structure, and don't mind your pages showing the .html extension, you should enable uglyUrls.

The URL management documentation for Hugo details both options.