My question is basically the same as this question from 2019.
I want to pass a file name into a shortcode like this
{{< market-data src="file_022524.json" >}}
This file is saved under the data/subData/ folder.
{{ range .Site.Data.subData.file_022524 }}
works fine but I would like this to be dynamic.
I’ve tried
{{ $source := .Get "src"}}
{{ $data := print ".Site.Data.subData." $source }}
{{ range $data }}
throws an error. I am guessing because it is a string and it is expecting a map.
New to Hugo and any help would be much appreciated.