# A language category

**URL:** <https://discourse.gohugo.io/t/a-language-category/44180>\
**Category:** support\
**Created:** [May 2, 2023, 5:58am UTC](https://discourse.gohugo.io/t/a-language-category/44180 "2023-05-02T05:58:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![idarek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/idarek/32/26229_2.png) [@idarek](https://discourse.gohugo.io/u/idarek)\
**Post date:** [May 2, 2023, 5:58am UTC](https://discourse.gohugo.io/t/a-language-category/44180/1 "2023-05-02T05:58:56Z")

</div>

> It’s a bit difficult to me to write right topic for that so if you will find better, please rename.

I got my website in Polish in main address `/` and my English in `/en/`. What I noticed, Hugo is generating a Language as a category and serving is under `/en/en/`. This starts to display exactly what is displayed under `/en/` with slight amendments based on templating for category listing.

**My question is, how to prevent Language to be put into Category bucket?** (I can use redirections to sort this as a temporary solution).

> My posts in Polish are placed under `/content/pl/` and `/content/en/` hence understand that this is generating that but `/en/en/`? Inside `/content/pl/` and `/content/en/` I don’t have `index.md` or `_index.md`, maybe thats a mistake, but just year folders where inside there are content segregated `/content/en/2023/`.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [May 2, 2023, 3:06pm UTC](https://discourse.gohugo.io/t/a-language-category/44180/2 "2023-05-02T15:06:26Z")

</div>

This is very difficult to troubleshoot without seeing your project, or a minimal reproducible example.

Need to see:

- site configuration
- content directory
- front matter (have you set `url` anywhere?)
- etc.

---

<div class="post-metadata">

**Author:** ![idarek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/idarek/32/26229_2.png) [@idarek](https://discourse.gohugo.io/u/idarek)\
**Post date:** [May 2, 2023, 7:41pm UTC](https://discourse.gohugo.io/t/a-language-category/44180/3 "2023-05-02T19:41:37Z")

</div>

Thanks @jmooring I have invited you over GitHub as repo is private.

I think the `/en/en/` is intended behaviour due to way how I got folders organised. Even doing redirect `/en/en/` to `/en/` still will produce link in sitemap hence would like to know if there is any workaround for it.

Thanks again for your help. No rush on that, when you will have time.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [May 2, 2023, 8:45pm UTC](https://discourse.gohugo.io/t/a-language-category/44180/4 "2023-05-02T20:45:58Z")

</div>

> [@idarek](#):
>
> is any workaround

Change your directory structure. Either `content/foo.en.md` or `content/en/foo.md`\[1\], but not both.

* * *

1. Must set contentDir per language in site config

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [May 4, 2023, 8:46pm UTC](https://discourse.gohugo.io/t/a-language-category/44180/5 "2023-05-04T20:46:52Z")

</div>

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