No way to have a multilingual site under one and only domain?

Like,

www.domain.eu/it/page1
and
www.domain.eu/fr/page1

rather than www.domain.it/page1 with www.domain.fr/page1?

It’d be much more handy - and cheaper. Should I really register and manage one domain for every language I plan to support?

Thank you very much for your kind help! :slight_smile:

1 Like

From Hugo’s point of view, both are equally simple (or hard …), so pick what fits your wallet.

1 Like

Soon II’ll have a multilingual site live that is all on one domain (2 languages). Once live I’ll put link here.

I used a combination of things, initially a post from here or an example from github which set me of in the right direcction. I don’t remember where… Try the examples in the Hugo repository.

Gosh, thanks. It’d be cool if there were some kinda official documentation, though. Please consider this as a humble (but critical IMO!) feature request. :slight_smile:

Yes - it will come. But the multilingual situation isn’t perfect in Hugo at the moment. It’s possible, but it will improve once we get some standardized ways to do localization in Go community.

1 Like

You could also take a look at this great tutorial written by @RickCogley. It describes how he setup his company’s website in mulitple languages.

1 Like

That’s up to you. Some people also use subdomains. There are pros and cons to each approach (SEO, etc), but as far as Hugo as concerned they are all about the same cost.

Yeah that’s what I was referring to. It assumes you have multiple domains. :slight_smile: Thanks

That tutorial @digitalcraftsman linked to looks good.

Actually I looked into it and rememered what I used, the example from @spf13 Hugo repository. https://github.com/spf13/hugo/tree/master/examples/multilingual

I basically copied this and made a couple of changes to how the public urls were made (so they didn’t sit inside, then worked the content and layout around it. Don’t remember more details at this stage because other aspects of it got more focus (galllery being one).

http://ulrichpolster.com

uses en and de sub directories below root. For building two different configs are used, reflecting the according baseurl for each language. You can switch between languages on page level.

After deploying nginx is taking care redirecting root to the language directory of the language to start with.

The key here seems to be two use different config, since else it would mix up diifferent content languages.

As soon as there is some spare time I’ll put the theme and some documentation, how everything is set up on github. Might take a few days though.

1 Like

Thank you SO much. This would be aweamazing. :slight_smile:

HI, ever got around to writing that tutorial on multilanguage sites under the same domain? It would be great to learn how you did it! Take care.

My personal home page does exactly that.

I have a post where I describe my setup and where you find a link to my git repository.

1 Like

The tutorial mentioned above has two domains, but I did this approach of subfolders in my http://esolia.pro site.

Maybe you can get some ideas from it. FYI.

1 Like

Yes, now you can have multiple languages under a single domain.
Here’s how to do it:
Multi-Language Hugo site under single domain with two-pass build. Multiple sites with shared static assets and themes, each site can have multiple language content trees, all under the same domain.
We show it invoked by entr, the non-polling watcher.
Enjoy. Feedback appreciated,
Yitzhak

Did you ever manage to put together a quick documentation?