joeroe / risotto

A minimalist, responsive hugo theme inspired by terminal ricing aesthetics.
https://risotto.joeroe.io
MIT License
418 stars 112 forks source link

Add a configuration key to enable multilingual support in the theme. Make it opt-in by default. #70

Closed aneveux closed 6 months ago

aneveux commented 6 months ago

Hello :wave:

Thanks a lot for the great theme!

I am very new to hugo (just started this evening), and I appreciate your theme for its simplicity and overall aesthetic.

While getting started with your theme, I was a bit puzzled by the $ echo $LANG label that was being displayed though, and noticed from #44 that you were actually not using multilingual, so probably not seeing this.

Again, being new to Hugo, I didn't find an easy and straightforward way to just get rid of multilingual, so I thought it could be interesting to just make that feature of the theme opt-in and hide it behind a configuration key, what do you think? Also that bit of code adds unnecessary br tags to the page.

In order to test this Pull Request, I checked that the multilingual selection thingy is not displayed when the key is not set or is false. When it is true though, it is displayed as it would be without the PR.

Let me know what you think, happy to rework this PR in any direction you'd recommend. Feel free to close it if that is not desirable.

Thanks again for the great work! :heart:

joeroe commented 6 months ago

Thanks for kind words and very thorough PR.

However, this shouldn't be necessary in the sense that multilingual support is already 'opt in'. That is, the language selection shouldn't be displayed unless there is more than one translation of that page. I can see that this is working as intended on the example site (one language, so no language switcher) but not on SSLARCH (one language, but phantom language switcher). We'll have to investigate why this is the case, I can't see what's happening at first glance (#71).

In the mean time, I would suggest you simply override this feature by creating a blank layouts/partials/lang.html in your site directory.

aneveux commented 6 months ago

Oh okay, I guess I indeed experienced #71 as well then.

Thanks a lot for the suggestion of a workaround with the layout override! Works great for me :heart: