I’m trying to take a page’s front matter, page.var
and use it to append to a liquid object {{ site.data }}
. I have a collection of data .yml
's and I would like to define which one to use with front matter.
---
var: something
---
Then, in another file,
{{ site.data.something }}
Ive tried pre assigning things like,
{% assign data = site.data %}
{% assign something = page.var %}
{{ data.something }}
But that doesn’t work.
Also,
{% assign data = site.data | append: '.' | append: page.var %}
{{ data }}
I would rather not use any if
's or similar conditionals as this would mean adding new conditionals every time I add a new var
option.