How to Organize Multilingual Content in Hugo

adriandra karuniawan s7wCpv jZKQ unsplash scaled
Genx Avatar

Managing multilingual content in Hugo can be simple and efficient if you use a clear folder structure. Here’s how you can organize your English and Japanese articles in separate folders while leveraging Hugo’s built-in multilingual features.

Organize your content by language at the top level:

content/
├── en/
│   ├── posts/
│   │   └── article3.md
│   ├── mind_and_body/
│   │   └── article1.md
│   └── tech/
│       └── article2.md
├── ja/
│   ├── posts/
│   │   └── article3.md
│   ├── mind_and_body/
│   │   └── article1.md
│   └── tech/
│       └── article2.md
  • Place all English articles in content/en/…
  • Place all Japanese articles in content/ja/…
  • Organize sections (like posts, mind_and_body, and tech) underneath each language

Hugo Configuration

In your hugo.toml (or config.toml), specify:

defaultContentLanguage = "en"

[languages]
[languages.en]
languageName = "English"
contentDir = "content/en"
weight = 1
[languages.ja]
languageName = "Japanese"
contentDir = "content/ja"
weight = 2

Benefits

  • No need to use .ja.md or .en.md filenames. The language is determined by the folder location.
  • Cleaner, more intuitive organization for large multilingual sites.
  • Hugo automatically links translations if you use the same filename and section structure for each language.

Summary

By configuring your site this way, you keep all your language content organized and make maintenance easy. Hugo’s built-in support will handle language switching and navigation automatically.

Share This Post:

Genx

in

Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

five × 1 =

Webmention: Have you posted a response to this article? Let me know the URL: