gohugo-theme-ananke
gohugo-theme-ananke copied to clipboard
Update Theme Template to Properly Indicate Current Language
I would like to suggest an update to the current theme template in order to correctly indicate the current language using the .Lang
variable instead of the static values .site.LanguageCode
and site.Language.Lang
.
Currently, the template uses the following code:
<html lang="{{ site.LanguageCode | default site.Language.Lang }}" ...
However, to accurately represent the current language, we should use the .Lang
variable.
I propose updating the template as follows:
<html lang="{{ with .Lang }}{{ . }}{{ else }}{{ site.LanguageCode | default site.Language.Lang }}{{ end }}" ...
With this change, the template will check if .Lang
is defined and use it as the language value. If it is not defined, it will fallback to site.LanguageCode
if available, or site.Language.Lang
if neither .Lang
nor site.LanguageCode
are available.
This modification ensures that the template accurately reflects the current language being used.
Thank you for considering this improvement.