As far as I understand contentDir, it only tells Hugo where to look for content.
Take for example, a non-multilang setup.
Say you have content foo.md. By default Hugo will look at content and if it finds content/foo.md it will be published at yoursite.com/foo/.
Setting contentDir to nested/content/dir, Hugo will then look at nested/content/dir/ and if it finds nested/content/dir/foo.md it will be published at yoursite.com/foo/.
Can you post a simple repo with your issue? I am not sure if I get it.
Maybe the frontmatter of your lproj files defines the slug wrong?
A full view would probably help to debug this. I would search for the issue not in translation setup but in the frontmatter and linkformat setup.
It generates the structure as expected - but it does not make use of any multi language features. I was now trying to see if it was possible to have a single layout with i18n support.
I think the languageCode is obsolete if you have multiple languages
You need to set defaultContentLanguageInSubdir to true so ALL languages are in subfolders
your german was weight 2, en was weight 1, so german was the main language in the index.html, then en in the subfolder, higher weight, more importance
with this setup you could produce two different websites under their own urls. set the baseURL property below the language to the baseurl you need.
I am not sure if that solves the main issue yet, because apart from the two language folders there is no root index.html to send people where ever they have to go and it takes some subfolders until we have the first index.html inside of the language folders. But it might be a beginning?
You donβt have contentDir configured for either language; so there is no way for Hugo to know which bits of content is in de vs en.
Additionally none of the content is in the format foo.xx.md or similar, xx being the language code. This means the content has no language explicitly assigned; therefore the content is all assigned to the default en.
So, in short, technically, Hugo sees all of your content as en (as defined in defaultContentLanguage).
I need the language subdir not be /en but /Contents/Resources/en.lproj
I think this here is really your problem. It seems Hugo uses the language code (ie en, de) as directory name to publish each language to.
Each language gets its own subdir under public, named after its language code. So it looks like (at least from how I understand the docs + the experimenting Iβve done) the language code dir name is included, and is based on the defined language code in the config.
public
βββ Contents
βββ Resources
βββ de
β βββ about
β β βββ index.html
β βββ index.html
βββ en
β βββ about
β β βββ index.html
β βββ index.html
βββ index.html
You could then rename /de/ to /de.lproj/ etc. You might also need to go into ...Resources/index.html to point to the correct url to redirect, and probably check that the URLs are formed correctly.
Or: add a file Contents/Resources/en.lproj/_index.md with:
aliases:
- "/en.lproj"
and the equivalent to de. This gives you:
public
βββ Contents
βββ Resources
βββ de
β βββ about
β β βββ index.html
β βββ index.html
βββ de.lproj
β βββ index.html
βββ en
β βββ about
β β βββ index.html
β βββ index.html
βββ en.lproj
β βββ index.html
βββ index.html
where /en.lproj/ redirects to /en/.
*Note that I am neither a Hugo dev nor a heavy user of the multilingual feature. Perhaps there is a better way I am overlooking.