Hello,
I’m trying to make a call from within a TOML file data, like so:
[featured]
current = "peter"
[featured.peter]
img = "/avatar.jpg"
[featured.peter.btn]
img = "btn.jpg"
[featured.rose]
img = "/avatar.jpg"
[featured.rose.btn]
img = "btn.jpg"
What I want is to change the value of current manually for anything I want, so when I call:
{{ .Site.Data.users.featured.current.btn }}
It displays the button info for rose, or peter, or anyone.
Problem is, as you might have guessed, that it shows me “peter” instead of the map.
My idea is to change current = “peter” and that the changes occur everywhere instead of manually changing all those calls.
{{ .Site.Data.users.featured.$current.btn }}
Doesn’t appears to work either, I can’t mix that into a variable.
Any ideas?