hugo-toha / toha

A Hugo theme for personal portfolio
https://hugo-toha.github.io
MIT License
979 stars 567 forks source link

Can not switch to english if another language is set by default #916

Closed florianley closed 2 months ago

florianley commented 3 months ago

Expected Behavior

My default language is french set with DefaultContentLanguage: fr in my config.yaml. I would like to be able to switch to english

Current Behavior

When I want to go from any language to english, I'm redirected to French

Steps to Reproduce

here is the configuration of my config.yaml for langage section : languages: fr: languageName: Francais disabled: false weight: 4 de: languageName: Deutsch disabled: false weight: 2 us: languageName: English disabled: false weight: 2 en: languageName: English disabled: false weight: 0

DefaultContentLanguage: fr defaultContentLanguageInSubdir: true

-> Open your website, try to switch to english. You are redirected to your default language

Screenshots

image

In this screenshot, href for english is href="/" but is correct for any other languages

Browsers Affected

tht commented 2 months ago

Same issue here when trying to set German (de) as default.

hossainemruz commented 2 months ago

I can confirm the issue.

hossainemruz commented 2 months ago

The issue should be fixed now. Please, try pulling the latest change. Specify defaultContentLanguage to your default language.

tht commented 2 months ago

Works for me, thanks a lot for looking into it and also for this lovely theme.