HUGO

Subdomains for multilingual site

I have a multilingual (4 languages) website running on hugo on gitlab(testing it). right now it has urls like https://exampleuser.gitlab.io/en/about and https://exampleuser.gitlab.io/ja/about

I want subdomains for urls like https://en.exampleuser.gitlab.io/about and https://ja.exampleuser.gitlab.io/about

Is it possible? I have added a custom domain to gitlab too. how to manage urls for both domains(pointing to the same directory, serving same content) as gitlab won’t allow primary subdomain to be removed from domain list.

You would need to treat each language as a separate Hugo project with its own subdomain as a baseURL.

Hugo’s multilingual mode works by outputting a subdirectory per language code.