How to change Hugo's generated html file path?

时间:2017-04-13 14:53:17

标签: hugo

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.

1 个答案:

答案 0 :(得分:2)

你只需要设置" uglyURLs"在命令行或配置文件中将参数设置为true。