Is there a way to do a data file / data structure query using string? As in something like:
{{ .Site.Data.$device.v1.type }}
I want to replace something the hard-coded selection like:
{{ if eq $device "mobile" }}
{{ .Site.Data.mobile.v1.type }}
{{ else if eq $device "desktop" }}
{{ .Site.Data.desktop.v1.type }}
...
{{ end }}
Help needed: I tried to title the problem as close as possible but I don’t think the sentence accurately represents it.
Thanks in adv.