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.

I am looking for something similar to this as well. I have a couple hundred posts now in by the /content/blog/ folder, and I’d just like to organize them for my own purposes to try and reduce clutter, and make it easier for myself to find recent posts.

I would love to be able to have my folder structure be /content/blog/{year}/{post} format, but have the slug just be /blog/post I agree with Keats’ post about not including years in the url and that is what I currently have, and what I am trying to keep.

I’m just looking for a way of achieving this by setting path in a /content/blog/2025/_index.md and have that base path for everything in the ./2025 directory but I seem to not be able to do that.

Is there any way to achieve this without having to set path on every post?

I haven’t tried it myself, but I’m curious if the transparent field on the sections in each year will help you? I see it documented at Section | Zola

I have a similar issue.

I like to keep my markdown files organised in subfolders off my content folder, such as /journal/ or /books/. This makes it easy to find related content during the creation/editing process. However, I don’t want these sub-folders as part of the final URL because all content is presented as a single stream and all post slugs should be at the top level of the site tree, eg, www.site.com/slug-of-each-post.

I know there’s the path override but as noted by the OP, it’s tiresome to have to write this in the front-matter for thousands of files when we already know its slug. I also don’t want to put the markdown files at the content root as that’s just a huge old mess and a recipe for chaos.

I propose a config option that will allow us to control whether a folder is included in the post’s path when generated. It could follow the format of the ignored_contentoption and simply be a table of folder names to remove from paths at render times, eg:

ignored_foldernames = [“journal”, “books”]

Then the output renderer could check against this and perform the necessary adjustments to the final location of the rendered posts. Would something like this be possible?

Another option could be to allow pattern matching in the path variable, perhaps something like this path = “/*” or path = “/dir1/dir2/*” where the asterisk is replaced by the slug at render time? If this path could also be setup in the section template, it would apply to all pages in that section, removing the need to add path to any individual page.

@Tecknet The transparent option doesn’t do anything with slugs, paths or urls. It’s just a way of making parent pages “aware” of the posts in subfolders, for building listings/index pages, etc.