DEV Community

ahandsel
ahandsel

Posted on

Debug: no languages configured error with Hugo

Error Message

Error: command error: failed to create config from result: failed to decode "languages": no languages configured
Enter fullscreen mode Exit fullscreen mode

Cause

Your Hugo's config file (config.yaml) is missing a languages section.

https://gohugo.io/content-management/multilingual/#configure-languages

Solution

Add the following line to your config file

defaultContentLanguage: en
Enter fullscreen mode Exit fullscreen mode

Of if you are supporting multiple languages:

# Multi-lingual mode config
defaultContentLanguage: en
languages:
  en:
    languageName: English
    contentDir: content.en
    weight: 1
Enter fullscreen mode Exit fullscreen mode

Resources:

Multilingual Mode - Hugo

Top comments (0)