No use of slug for categories and tags

Unsure if that intentional, but I found a bit of discrepency.

I got site
/about/

that contain index.md with

---
title: "About"
url: '/about/'
---

for English language.

Than I got index.pl.md to add Polish translation.

In it I got:

---
title: "O Nas"
slug: '/o-nas/'
---

Main is using url the other is using slug

English will be example.com/about/
where Polish will become example.com/pl/o-nas/

All working well, however this idea cannot be used in /categories/ and /tags/ pages that agregating list of categories and list of tags.

For each indivudual category and tag, I can use hugo.toml to specify using

    [languages.pl.permalinks]
      tags = "/tag/:slug/"
      categories = "/:slug/"

However slug doesn’t seams to be used in categories and tags.

I created /categories/ folder and placed _index.md and _index.pl.md there.

To make it working in _index.pl.md I need to specify it as

url: "/pl/kategorie/"
aliases: "/pl/categories/"

only because slug

slug: `/kategorie/`

is not working.

Is that intentional?

ps. its not a big issue.

Is this a typo? These should be _index.md files, not index.md files.

I’ve read through your post a few times, and I don’t understand the objective or problem. Maybe we can start with a simple test site and go from there…

git clone --single-branch -b hugo-forum-topic-50038 https://github.com/jmooring/hugo-testing hugo-forum-topic-50038
cd hugo-forum-topic-50038
hugo server
1 Like

Yes, corrected.

I will play with test repot that you set and will come back to you with feedback.

I just force pushed a change. Please re-clone if you have already cloned it. I won’t force push again.

No problem, will look on that in few hours.

1 Like

Thank you for your example.

There were some things

[languages.en.permalinks.taxonomy]
categories = "categories"

[languages.en.permalinks.term]
categories = "/:slug"

[languages.pl.permalinks.taxonomy]
categories = "kategorie"

[languages.pl.permalinks.term]
categories = "/:slug"

that I didn’t know and use here :slight_smile:

Will try in my environment.

always learning.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.