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: mysite.com (EN) and mysite.co.jp (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 mysite.com to mysite.github.io.
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 mysite.co.jp point to the content in content/ja? Do I need DNS/Web masking so that mysite.co.jp points to mysite.com/ja?
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. mysite.com/ja/index.html or mysite.co.jp/en/index.html)
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.
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: