Simone
Simone

Reputation: 1337

Change a Content Section's name in the URL

I have a content section called foo, with several pages whose path is content/foo/pageNNN.md. They are rendered at /foo/pageNNN/index.html.

What if I wanted my foos to become bars? Do I have to rename the folder, or is there a way to just change the destination URL to /bar/pageNNN/index.html?

Upvotes: 1

Views: 1267

Answers (1)

Mr. Hugo
Mr. Hugo

Reputation: 12592

Write this in your config file:

permalinks:
  foo: /bar/:filename

Source: https://gohugo.io/content-management/urls/#permalinks-configuration-example

Upvotes: 1

Related Questions