I have multi language site (english and russian).
In my baseof.html <html lang="{{ .Site.Language.Lang }}">
.Site.Language.Lang contains current site language (“en” or “ru”)
But the same variable in JS script console.log('{{.Site.Language.Lang}}')
always contains the same value (“ru”).
Info from hugo env
Hugo Static Site Generator v0.56.3/extended darwin/amd64 BuildDate: unknown
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.12.7"
Where should I seek the problem?
maiki
2
Share your code, per Requesting Help.
Updated first post with links to the files and info from hugo env. Do you need anything else?
yktoo
4
Your website seems to be down, can’t reach it.
Do you pass your JS file via a template? If so, you can generate pages locally and just check what’s in your JS file under public/
.
maiki
5
I generated two sites (english and russian) and under public/
in both sites there is the same value.
I add scripts to html like this:
{{ $scriptJS := resources.Get "script.js" | resources.ExecuteAsTemplate "search.js" . | minify | fingerprint }}
<script defer src="{{ $scriptJS.RelPermalink }}"></script>