Using Site.LanguageCode Variable in Conditionals (solved)

Hi,

i’m very new with Hugo. I try to add RTL support to my page.

<html class="no-js" lang="{{ .Site.LanguageCode }}" dir="{{ if isset .Site.LanguageCode "ar" }}rtl{{ else }}ltr{{ end }}">

That’s what I tried. But it does not work. When I show the variable via

{{ .Site.LanguageCode }}

it show’s up ar
But the outcome of the conditional is every time “ltr”. It also does not work without “isset”. How can I solve this?


Found out I had to use {{ if eq .Site …