As part of a site migration in French and German:
- old static site, hand-crafted 10 years ago:
everything at the root (e.g./contact/
and/kontakt/
) - new site with Hugo:
languages in directories (e.g./fr/contact/
and/de/kontakt/
)
I use links between pages via translationKey and this config:
defaultContentLanguage = “fr
defaultContentLanguageInSubdir = true
and the link between pages by translationKey
I’d like to congratulate and thank Hugo’s developers for the incredible multilingual support.
My only (small) problem is the root page. Obviously, I have 2 “roots” for each language (/fr/
and /de/
), but there’s still the question of the naked domain name (/
).
A redirect page to the default language is created, and that’s a good idea. But is it the best?
Firstly, can the generation of this page simply be deactivated?
Secondly, I’d like the /
page to be a copy of the /en/
page rather than a link to the /en/
page. Since all my links and menus are done correctly, they’ll go where they’re supposed to. And as I’m using the canonical tag correctly, no SEO problem.
Is it possible (in pure Hugo) to copy (or generate a second identical copy of) the /fr/
page and publish it in /
? I couldn’t find anything in the documentation
Of course, this is easy to do when sending via FTP or beforehand via a cp
in /public/
. But with Hugo only, is it possible?
NB: The starting point, as this is a migration, is the possibility of launching a reindex in Google Search Console for /
, which is impossible on the default redirection page (noindex, etc.).