CaiJimmy / hugo-theme-stack

Card-style Hugo theme designed for bloggers
https://stack.jimmycai.com
GNU General Public License v3.0
4.89k stars 1.6k forks source link

Language Switcher is present although the site is not multilingual on the latest Hugo #954

Closed FarrelF closed 7 months ago

FarrelF commented 7 months ago

What happened?

The language switcher (i18n-switch) are exists even if the site is not set as multilingual when using the latest version of Hugo Extended and the switcher doesn't contain anything when selected.

There is a screen capture video:

https://github.com/CaiJimmy/hugo-theme-stack/assets/29566218/d56a4edf-5669-429e-96fe-eb0f2ed6d0b1

I thought this was a Hugo cache issue and this issue are happen to only my blog before, but I think it's not. I tried using the site from CaiJimmy/hugo-theme-stack-starter repo, but still got the same result, the language switch is still there too.

There is a screen capture video for CaiJimmy/hugo-theme-stack-starter site:

https://github.com/CaiJimmy/hugo-theme-stack/assets/29566218/bb6c1080-5c2e-4977-b972-1b155948218e

How to reproduce it:

  1. Use the latest version of Hugo Extended (in my case, I used version 0.123.2)

  2. Clone the CaiJimmy/hugo-theme-stack-starter repo, then navigate to it

  3. Build and render the site using hugo server command as usual. In my case, I used the following command:

    hugo server --gc --renderStaticToDisk --tlsAuto
  4. If the site build and renders successfully as usual, then use your browser to visit the site and look at left sidebar, the language switcher should be there.

I don't know this is a upstream bug or not, because Hugo introduced some breaking changes since version 0.123.0

Hugo version

0.123.2

Theme version

3.21.0

What browsers are you seeing the problem on?

Firefox, Chrome, Microsoft Edge

More information about the browser

Vivaldi 6.5.3206.63 (Chrome 120.0.6099.293)

Relevant log output

No response

Link to Minimal Reproducible Example

https://github.com/CaiJimmy/hugo-theme-stack-starter

FarrelF commented 7 months ago

Thanks to @jamesmcmurry, this issue/problem has been fixed using PR #950. I think you should review and consider to merge his Pull Request since the issue are reproducible even with your hugo-theme-stack-starter repo using latest version of Hugo Extended.

CaiJimmy commented 7 months ago

Thanks for reporting, I've reviewed the PR and will merge it soon.