Multilingual site duplicates assets

#1

Hi everyone,

I managed to setup and use Hugo pretty fast and I have to commend you guys on the work you did because it’s an amazing platform.

There’s a few issues that I wasn’t able to fix by myself concerning content organisation and the files that it generates.

  1. Sitemap Index generation

Sitemaps are generated but no sitemap index to be seen anywhere.

  1. Duplicated assets

My theme uses some local images, CSS stylesheets and JS scripts that are minified and the permalink is then used for the src or href attribute value.
The issue is that these assets are duplicated for each site language and placed at the root of the language directory instead of the root of the public directory.
This means that even though the files are identical, users would need to download them all over again when they switch languages.

  1. Permalink unchanged by mutation

This might be unrelated to the multilingual option but it seems that if a language root homepage has a list of posts in that language, the pages generated for the pagination results in the /en/page directory will have a permalink equal to /en/ instead of /en/page/1/

My file structure looks like this:

content/:lang/:section1/:section2/foo-bar/index.md

Sections at level 1 and 2 all have _index.md files to set a custom title.

My config file looks like this:

theme = "mytheme"

[permalinks]
  blog = "/:sections/:slug"

[languages]
  [languages.en]
    baseURL = "https://www.mydomain.com/en/"
    contentDir = "content/en/"
    languageName = "English"
    languageCode = "en-US"

  [languages.fr]
    baseURL = "https://www.mydomain.com/fr/"
    contentDir = "content/fr/"
    languageName = "Français"
    languageCode = "fr-FR"

  [languages.es]
    baseURL = "https://www.mydomain.com/es/"
    contentDir = "content/es/"
    languageName = "Español"
    languageCode = "es-ES"

Thanks in advance!

0 Likes

#2

Has anyone managed to fix the issues I mentioned above?
Help is definitely appreciated!

0 Likes