Adding category name to post url

hey is there anyway i can add the category to the posts url
example ; example.com/tech/google-new-phone

The available fragments are listed at https://gohugo.io/content-management/urls/#permalink-configuration-values.

Since you want a single “category”, it could be your content is structured into sections (rather than a taxonomy). So you’d have /content/tech/google-new-phone.md and use :section.

hi thanks for the reply :smile: i am a newbie here so still don’t know how to work with hugo
my website have multiple categories if i add this posts: section/slug to my config will it work
automatically

No, you’ll need to understand the difference between a taxonomy (category) and a section in Hugo.

There is no config to do what you want. I was suggesting you change the structure of your files. I take that suggestion back; what you want it not currently possible without changing a lot of your content.