Change slug of categories page

This seems pretty simple and I am probably missing something really small.

I have:

/content
  |
  +->/categories
      |
      +-> _index.md

The _index.md:

---
title: Tests
slug: tests
---

The title is correctly displayed, but the slug stays categories instead of test.

In my config I use:

[permalinks]
categories = "/test/:slug/"

What am I missing?!

In your front matter for categories/_index.md, you probably want

---
title: Tests
url: tests
---

Although it might be test to match your permalinks.

Hey, why don’t you just make a taxonomy called tests?

2 Likes

Thanks @maiki, this works. But can you explain why? Is slug only used for single pages and url for list pages, is that the explanation / reason slug didn’t work?

My example was simplified. I wanted to rename the permalinks for translations:
url: categories_index.en.md (guess I could omit this because it’s default)
url: kategorien_index.de.md
and so on.

I’m trying to figure how I knew that, and I figure it was gleaned from experience. Permalinks are patterns for normal pages, not lists, which a section root is. As you wanted to override a list page via front matter, it wouldn’t otherwise pick up a permalink pattern. :thinking:

In the future, I’d be verbose with the live examples. Had you mentioned your area of thinking you would have gotten numerous responses from multilingual users having solved your exact issue. :slight_smile: