Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Env HUGO_DISABLELANGUAGES is not working after v0.111.3 with multiple values #11278

Closed
dbaio opened this issue Jul 21, 2023 · 3 comments · Fixed by #11294
Closed

Env HUGO_DISABLELANGUAGES is not working after v0.111.3 with multiple values #11278

dbaio opened this issue Jul 21, 2023 · 3 comments · Fixed by #11294
Assignees
Milestone

Comments

@dbaio
Copy link

dbaio commented Jul 21, 2023

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.112.0+extended freebsd/amd64 BuildDate=2023-07-20T22:16:20Z-0300 VendorInfo=freebsd

and

$ hugo version
hugo v0.115.4+extended freebsd/amd64 BuildDate=2023-07-20T22:31:17Z-0300 VendorInfo=freebsd

Does this issue reproduce with the latest release?

yes


Behavior with v0.111.3:

$ hugo version
hugo v0.111.3+extended freebsd/amd64 BuildDate=2023-03-17T03:01:46Z+0000 VendorInfo=freebsd

$ HUGO_DISABLELANGUAGES=" bn-bd da de el es fr hu id it ja ko mn nl pl ru tr zh-cn zh-tw" hugo config | grep -i disablelanguage
disablelanguages: "bn-bd da de el es fr hu id it ja ko mn nl pl ru tr zh-cn zh-tw"

$  HUGO_DISABLELANGUAGES="fr es" hugo config | grep -i disablelanguage
disablelanguages: "fr es"

And now with v0.112.0 and v0.115.4:

$  hugo version
hugo v0.112.0+extended freebsd/amd64 BuildDate=2023-07-20T22:16:20Z-0300 VendorInfo=freebsd

$ HUGO_DISABLELANGUAGES=" bn-bd da de el es fr hu id it ja ko mn nl pl ru tr zh-cn zh-tw" hugo config | grep -i disablelanguage
disablelanguages = ['bn-bd da de el es fr hu id it ja ko mn nl pl ru tr zh-cn zh-tw']

$ HUGO_DISABLELANGUAGES="fr es" /usr/local/bin/hugo config | grep -i disablelanguage
disablelanguages = ['fr es']
$ hugo version
hugo v0.115.4+extended freebsd/amd64 BuildDate=2023-07-20T22:31:17Z-0300 VendorInfo=freebsd

$ HUGO_DISABLELANGUAGES=" bn-bd da de el es fr hu id it ja ko mn nl pl ru tr zh-cn zh-tw" hugo config | grep -i disablelanguage
disablelanguages = ['bn-bd da de el es fr hu id it ja ko mn nl pl ru tr zh-cn zh-tw']

$ HUGO_DISABLELANGUAGES="fr es" /usr/local/bin/hugo config | grep -i disablelanguage
disablelanguages = ['fr es']

The intended behavior should be disableLanguages = ['fr', 'es'], right?
This other way, hugo is building all languages every time.

@jmooring
Copy link
Member

jmooring commented Jul 21, 2023

With v0.112.0 and later...

PASS - Disable multiple languages in site configuration via language object

[languages.en]
weight = 1

[languages.de]
disabled = true
weight = 2

[languages.fr]
disabled = true
weight = 3

PASS - Disable multiple languages in site configuration via root setting

disableLanguages = ['de', 'fr']

PASS - Disable a single language via environment variable

HUGO_DISABLELANGUAGES="de" hugo

FAIL - Disable multiple languages via environment variable

HUGO_DISABLELANGUAGES="de fr" hugo

We have the same failure with...

HUGO_DISABLEKINDS="RSS taxonomy term sitemap" hugo

The above worked prior to v0.112.0.

@dbaio dbaio changed the title Env HUGO_DISABLELANGUAGES is not working after v0.111.3 Env HUGO_DISABLELANGUAGES is not working after v0.111.3 with multiple values Jul 21, 2023
@dbaio
Copy link
Author

dbaio commented Jul 21, 2023

With v0.112.0 and later...

This works (disables a single language):

HUGO_DISABLELANGUAGES="de" hugo

This does not (does not disable any language):

HUGO_DISABLELANGUAGES="de fr" hugo

I've changed the PR title to 'is not working with multiple values'. Thanks.

@bep bep removed the NeedsTriage label Jul 27, 2023
@bep bep self-assigned this Jul 27, 2023
@bep bep added this to the v0.116.0 milestone Jul 27, 2023
bep added a commit to bep/hugo that referenced this issue Jul 27, 2023
bep added a commit to bep/hugo that referenced this issue Jul 27, 2023
bep added a commit that referenced this issue Jul 27, 2023
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Jul 28, 2023
This includes a patch from the master branch/next release:
gohugoio/hugo#11278

Changelog:  https://github.com/gohugoio/hugo/releases/tag/v0.115.4
Approved by:	doceng (implicit)
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants