Goodmorning everyone,
I’m having a problem understanding why the following code in my baseof.html isn’t working:
...
{{- if eq .Site.Language "en" -}}
<a href="{{ .Site.BaseURL }}">{{ .Site.BaseURL }}</a>
{{- if .Param "showrss" }}<br><br><a href="/index.xml"><img src="/rss.svg" style="max-height:1.5em" alt="RSS Feed" title="Subscribe via RSS for updates."></a>{{ end }}
{{- end -}}
{{ if eq .Site.Language "it" }}
<a href="https://lorenzocesana.xyz/it">https://lorenzocesana.xyz/it</a>
{{- if .Param "showrss" }}<br><br><a href="/it/index.xml"><img src="/rss.svg" style="max-height:1.5em" alt="RSS Feed" title="Subscribe via RSS for updates."></a>{{ end }}
{{ end }}
...
My scope here is: if the .Site.Language is “it”, then show the html that is between the if and the end; if is in “en” show that code instead.
I tried to print out the .Site.Language variable and is set as expected, “it” in the italian version and “en” in the english version.
As of now the output is blank: nothing at all (regarding the html between these two blocks) is displayed on the webpage.
I point out that the absence of “-” in the second statement is only because I was trying it out many combinations.
Thanks in advance