I have a multilingual site with en, de, and fr as the available languages. The default language is en as I have configured in the config.yaml file:
defaultContentLanguage: "en"
I want the logo inside the navigation bar to redirect to the homepage or my site. However, by using the following snippet, when the current language is the default one (en), the the generated link is localhost/en.
<a class="navbar-item" href="/{{ $.Site.Language }}">
I want it to be localhost when the current language is the default one and localhost/de and localhost/fr respectfully for the other languages.
How can I access the defaultContentLanguage setting in order to do something like this?
<a class="navbar-item"
href="/{{ if ne .Site.Language.Lang .Site.defaultContentLanguage }}{{ $.Site.Language }}{{ end }}">
The related issue I found is this one, but I didn’t find an answer: