White Cabinet

Hugo Theme

Going global

Posted on 9 Mar, 2020

Hugo allows you to make your website multilingual. Check Multilingual mode for the details.

If you want to set your default language as English, and add Japanese as a secondary language, it can be done by adding

DefaultContentLanguage = "en"
defaultContentLanguageInSubdir = true

and

[Languages]
[Languages.en]
  weight = 1
  title = "THE TITLE OF YOUR SITE"
[Languages.en.params]
  Language_name = "English"
  subtitle = "THE SUBTITLE OF YOUR SITE"
  ...

[Languages.ja]
  weight = 2
  title = "ウェブサイトのタイトル"
[Languages.ja.params]
  Language_name = "日本語"
  subtitle = "ウェブサイトのサブタイトル"
  ...

to the config.toml. For the menus, you can add identical entries for the English version and the Japanese version as

[[Languages.en.menu.main]]
  ...

[[Languages.ja.menu.main]]
  ...

The method of setting menu contents will be presented in the Create a section page.