Hello all,
I have set up multiple languages for hugo.
config.toml
[languages]
[languages.en]
[languages.en.params]
[[languages.en.params.address]]
email = "contact@domain.com"
address = "RM 99, No. 87, West Road, LA, CA, USA"
[languages.es]
[languages.es.params]
[[languages.es.params.address]]
email = "contact@domain.com"
address = "1234"
And I read it in html
file
{{ $address := .Site.Params.address }}
{{ $address }}
It prints [map[address:RM 99, No. 87, West Road, LA, CA, USA email:contact@domain.com]]
, I tried to use {{ $address.email }}
and {{ $address.address}}
to get the value of each parameter, but I got an error
execute of template failed at <$address.email>: can’t evaluate field email in type []interface {} render of "page" failed: can’t evaluate field email in type []interface {} failed to render pages: can’t evaluate field email in type []interface {}
How to fix this? Thank you.