okkur / syna

Highly customizable open source theme for Hugo based static websites
https://syna.okkur.org/demo/
Apache License 2.0
250 stars 134 forks source link

Opposite language selection on start page / #759

Closed schoettl closed 4 years ago

schoettl commented 4 years ago

Thank you for this theme!

Is this a BUG REPORT or FEATURE REQUEST?: bug

What happened: I set up a multi-lingual site. English is default language. Translations works for all pages except for content/_index/.

As soon as I cp _index/index.md _index/index.de.md, the home page is empty for the default language, and in English for the German "de" version. In short:

It's totally the opposite, but only for the homepage?!

What you expected to happen: / should be English /de/ should be in German

How to reproduce it (as minimally and precisely as possible): Do you already have a guess? Otherwise I have to setup a new project to create a minimal example.

Anything else we need to know?:

Environment:

schoettl commented 4 years ago

EDIT: I updated the description above. The problem is the _index folder which describes the homepage / and /de/.

stp-ip commented 4 years ago

Interesting. This does feel like a bug and most likely comes from our theme specific code making the idea of fragments work on the index page etc.

No specific solution in my mind yet.

schoettl commented 4 years ago

Does it help, if I provide a minimal example based on https://git.okkur.org/syna-start ? As a patch or a GitHub fork?

stp-ip commented 4 years ago

A minimal example showcasing the issue already helps. Based on syna start seems reasonable as it does have a lot less moving parts. You can link to a branch on your fork for this.

Thanks for helping out.

mpourismaiel commented 4 years ago

Not sure how this was happening, it might have something to do with params.DefaultContentLanguage which might not have been set. Set it to your default language. Not that we require this value in addition to Hugo's own DefaultContentLanguage (which is located in the top section of the config file).

Please check #763. Closing issue, let us know if the problem persists.