But… But… But it’s returning the array of data files.
Explaining better.
Inside data, I have a cases directory. Inside it, a directory for every language. So:
/data/cases/en/*.yaml
/data/cases/pt/*.yaml
I’m trying to get the specific cases of the current language, limit and sort the by .home.weight. To limit, I’m using a conditional, {{ if .home.weight }}. But I can’t understand why the code is working and reporting error at the same time.
The following code gives no error, but I can’t hardcode the language.
{{ range sort $.Site.Data.cases.en ".home.weight" }}
I found out that this code gives me a build error only if used in the index.html in the root of layouts folder.
I successfully used it in every other page of the project.