A language category

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/.

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.

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.

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 ↩︎

1 Like

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