Skip to content

HUGO_DISABLELANGUAGES fails to override disableLanguages = [] correctly #13707

@ZhenShuo2021

Description

@ZhenShuo2021

When disableLanguages = [] is set in config, the HUGO_DISABLELANGUAGES env var is not parsed correctly — it's treated as a single string, not a list.

# With `disableLanguages = []` in config:
HUGO_DISABLELANGUAGES="ja zh" hugo config | grep -i disablelanguages
# >>> disablelanguages = ['ja zh']

# Without `disableLanguages` in config:
HUGO_DISABLELANGUAGES="ja zh" hugo config | grep -i disablelanguages
# >>> disablelanguages = ['ja', 'zh']

How to reproduce:

  • hugo new site
  • Create content/_index.en-us.md, _index.ja.md, _index.zh.md
  • Add these to hugo.toml
disableLanguages = []

[languages.en-us]
[languages.zh]
[languages.ja]
  • Run the above commands

Version:
hugo v0.147.1-95666fc5a4fd2d87528a1a69d562e0538a97062a+extended
macOS 15.3.2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions