How to hide section slug in url

I have folder structure like below

├── content
│   ├── _index.md
│   ├── section1
│   │   ├── _index.md
│   │   ├── post1
│   │   │   ├──  index.md

I want the url of post1 to be /post1 instead of /section1/post1. Is there any way to do that?

Currently, I have make it work by setting path in post index.md. However, in my project, I have multiple nested sections to organize posts by year, category, etc.

I need to hide some section slugs in url to make it clean. If I use path in every page, It would be inconvenient to add prefix for each one.