Felix
Felix

Reputation: 2851

How to change Hugo's generated html file path?

I'm using Hugo to generate my local Html help files.

when I type:

hugo new how-to-upgrade.md

What I'm expecting is a file named how-to-upgrade.html in the root folder. But actually I get how-to-upgrade\index.html file, with a folder and then a file in the folder.

I know it makes no difference using a web browser for http://localhost:1313/how-to-upgrade/ or http://localhost:1313/how-to-upgrade/index.html. (actually, hugo server is jumping from the latter link to the former one.) But it makes big difference when openning the html files as local files.

file:///C:/Users/Documents/hugo/public/how-to-upgrade/ will list all files in the folder like an old ftp site.

file:///C:/Users/Documents/hugo/public/how-to-upgrade/index.html is the html help file.

Now what I need is to generate local files like

file:///C:/Users/Documents/hugo/public/how-to-upgrade.html

without the folder.

Upvotes: 1

Views: 1198

Answers (1)

Dave Lewis
Dave Lewis

Reputation: 46

You just need to set the "uglyURLs" parameter to true on the command line or in your config file.

Upvotes: 3

Related Questions