Override section url

So I “solved” this by:

  1. Override permanlinks of “product” section in config.toml file by
[Languages.fr.permalinks]
product = "/produit/:slug"
  1. Add alias for section URL by putting this into _index.md file
aliases = ["/produit"]

This way, it’s guaranteed that /produit and /produit/produit-1 both works. For English language, I don’t do anything so by default /product and /product/product-1 should work.

In my opinion, this is not a recommended way though, just some workaround to make sure even I give https://example.com/fr/produit link to customer, it still works (by redirecting back to /product which is okay for now).

Still, clean and native solution from Hugo would be hugely appreciated.

Thanks!

1 Like