Let say I have a content file called mypost.md in a folder posts. When I run hugo to build the page, I can access the built page at /posts/mypost. However, I want all the contents are lie at the root path, i.e the link should be example.com/mypost/ instead of example.com/posts/mypost. I know I can create the content at the content’s root folder. However, I also want to group the files into directories for easy management. How can I achieve this? Thank you in advance.
Hi,
You can configure the Permalinks: https://gohugo.io/content-management/urls/#permalinks-configuration-example
1 Like
I use domain.tld/title-post/ to all of my url posts inside content folder and subfolder. I only add this part to my config.yaml ->
permalinks:
yourfoldername: /:title/
yoursubfoldername: /:title/
youranotherfoldername: /:title/
Thank you. It works.
1 Like