Skip to content

Top-level Url Path For Your Zola Article

Part of this project's file system looks like this:

content
├── _index.md
├── articles
│   └── zola_urls.md

However, I didn't want this article to appear under /articles/zola-urls. Urgh, ugly. I wanted it to be found under /zola-top-level-url-path.

Here's a quick way to get this done. I have to look it up ridiculously often. (You're welcome future-me.)

Enter Page Front Matter

You can find it in the Zola docs over here.

Just add a path line, similar to this:

title = "Top-level Url Path For Your Zola Article"
path = "/zola-top-level-url-path"

This single path entry will make sure, that your article is available via the disered path. Freed from the directory hierarchy and the file name.

If you just want to change the slug... Well, adding slug to the front matter is the thing you're looking for.