hector-sab / hectorsabblog

1 stars 0 forks source link

Change default path of Hugo pages #2

Closed hector-sab closed 1 year ago

hector-sab commented 1 year ago

When adding a new page to Hugo (command below for example), when rendering on the browser, it will open at www.example.com/pages/about/. I want it to be www.examples.com/about.

hugo new pages/about.md
hector-sab commented 1 year ago

Found this, it seems to document how to change this. https://gohugo.io/content-management/urls/

hector-sab commented 1 year ago

Yeah, that made it. I needed to put this below in the config.toml.

[permalinks]
    pages = "/:title/"
hector-sab commented 1 year ago

Now I wonder how it's going to work for multi language websites...

hector-sab commented 1 year ago

Yeah, it works too. I added the following page in Spanish and it worked just fine. The page shows at www.example.com/es/about/.

hugo new pages/about.es.md