Multilingual Domains and GitHub Pages

I’m trying to deploy a Japanese translation of my site to GitHub Pages and I’m a little unclear on the DNS and GitHub repo parts.

My goal is to have separate domain names for each site: (EN) and (JA).

I organized my translated content into separate directories, so content/en for English and content/ja for Japanese. The English site is currently hosted in a GitHub repo on the master branch with DNS entry for to

I guess my question is: Where do I publish the Japanese site? In the same repo as the English site or to a new repo?

If both sites are hosted from the same repo, then how does the DNS entry for point to the content in content/ja? Do I need DNS/Web masking so that points to

If each site is hosted in its own repo, is there a way to only publish the translated content folder to that repo? I wouldn’t want all language content available on both sites (e.g. or

For the Hugo part of this puzzle you want to use Hugo’s multihost mode (search docs).

Thanks for confirming. Yes, I have multihost configured and working as expected on localhost:1313/localhost:1314.

For the GitHub Pages part, I think I need a separate repo for the Japanese site because there can only be 1 CNAME file per repo. But what I’m still unclear about is how the DNS and CNAME config would point to the content/ja folder and not the default content/en folder.

  • DNS resolves domain names to IP addresses
  • IP addresses are where web servers operate
  • Web servers map requests to files paths

With GitHub you don’t have that functionality. You’ll probably need to deploy the sites separately (meaning one repo for English, one repo for Japanese, as if they were different sites) using some configuration/environment changes.

The web hosting server at GitHub, to my understanding, won’t make this easy for ya. The multihost feature works when one can control the behavior of the web server; you’ll need to check the GitHub Pages docs to see how to get that working for your case.

Just to close the loop on this one…each site does need its own repo in GitHub Pages. With a single language site, the hugo command can generate the site directly to the GitHub Pages repo. But with a multilingual site, the hugo commands generates both sites at once into a single folder witih sub folders for each language. This just adds an extra step to my deployment.
So in summary:

  • separate CNAMEs for each site
  • separate GitHub Pages repos for each site