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

defaultContentLanguageInSubdir does not apply if only one language is enabled #10064

Closed
paperdigits opened this issue Jul 2, 2022 · 4 comments

Comments

@paperdigits
Copy link

paperdigits commented Jul 2, 2022

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

0.101.0

Does this issue reproduce with the latest release?

Yes

We use hugo to build the darktable docs: https://github.com/darktable-org/dtdocs

The translations are generally a bit behind the main English text, since this is about 300 pages worth of instruction.

When we are ready to make a release of the English documentation (this is the only language that needs to be ready at release time, then we update as translations finish), we disable all other languages. We're using the multilingual site configuration.

When only English is enabled, hugo builds the site as if we were not using multilingual mode. This breaks all our URLs and folder structure, since we expect English to build into the en subfolder instead of into the root of public.

I'm not sure if my thinking is correct or not, but I think that if multilingual mode is enabled, then hugo should follow the output rules, no matter how many languages are enabled.

@elstoc
Copy link

elstoc commented Jul 2, 2022

To clarify, we disable languages by using env HUGO_DISABLELANGUAGES="$disabled_languages " hugo --config "$HUGO_CONFIG" -d "$HUGO_DIR" so all the languages are defined in our config but only the default language is enabled (because $disabled_languages includes everything except en)

@jmooring
Copy link
Member

jmooring commented Jul 2, 2022

This issue has been raised before:
#5299 (closed by stalebot)

MRE

git clone --single-branch -b hugo-github-issue-10064 https://github.com/jmooring/hugo-testing hugo-github-issue-10064
cd hugo-github-issue-10064
hugo server

@jmichelgarcia
Copy link

Supper annoying that #5299 was closed by stalebot. I just lost 5 hours trying to understand this.
In my case, I only use one language, but would like to nevertheless use url prefixes /en.

Keen to hear if anyone has solved this.

@jmooring jmooring changed the title using the multilingual site option does not apply if only one language is enabled defaultContentLanguageInSubdir does not apply if only one language is enabled May 30, 2023
@bep bep added this to the v0.116.0 milestone Jul 7, 2023
bep added a commit to bep/hugo that referenced this issue Jul 8, 2023
bep added a commit to bep/hugo that referenced this issue Jul 8, 2023
@bep bep closed this as completed in 92e8670 Jul 8, 2023
@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 Jul 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants