Is there a good way to cross-reference data from multiple data files in Hugo?
I’m bringing in a data file from externally, so i can’t edit that, but I have my own source where I’m defining names based off id numbers.
Source data file (example record):
{
"list":[
{
"nameId":"1610612761"
}
]
}
Supplemental data file:
{
"names": [
{
"nameId": "1610612761",
"name": "Fred"
}
]
}
My hugo template so far:
{{ range $index, $element := .Site.Data.source.list }}
{{ $element.nameId }}
{{ end }}
That works to display the nameId, of course. But how do I index that with my supplemental data file to replace the id with the string name? index
is probably the answer somehow, but I can’t wrap my mind around how it might work, perhaps in conjunction with a nested range
?