In this guide I will explain how to create a Hugo theme page that displays data from the data
folder for a multilingual site.
In order for this to be possible, the versions of the files in the data
folder must be placed in subfolders with the language code as their name. For example if we have a multilingual site in Italian and English and the file has the name bio.json
, we will have:
data/it/bio.json
data/en/bio.json
The theme page is composed as follows:
{{ $data := index .Site.Data $.Site.Language.Lang }}
{{ range $data.bio }}
{{ end }}
An example of this page can be found at this link