Hello, internet.

The multilingual setup for Hugo is done, so blogging in Japanese has finally become easy. 😎

Hugo supports multiple languages out of the box, so it is fairly straightforward, but you do need to add a few settings.

First, the blog content has to be separated by language. There are two ways to do this:

  • separate file names
  • separate folders

With separate file names, you end up with too many files and things get hard to manage, so I went with separate folders.

  • content/english
  • content/japanese

As the names say, they hold the English and Japanese content. I put a configuration like this into config.toml:

[languages.ja]
languageName = ":jp:"
contentDir = "content/japanese"
footercontent = "ζ₯½γ—んでいってね。"

(As an aside, I am not a big fan of abbreviating japanese to ja.)

Add a contentDir for English in the same way.

After that, you need to add per-language settings such as menus. For the details, take a look at the source code hereβ€”it should be self-explanatory. It is admittedly a bit verbose. πŸ˜…

By the way, “About” is surprisingly hard to translate into Japanese. I considered things like “About this blog” or “Profile,” but the internet meme γ“γ‚Œγ―δ½•οΌŸ (“What is this?”) felt like the best fit. I am not just fooling around, honest.