I have a data folder structure:
_data/footer/1.yml
_data/footer/2.yml
etc
What I want to do is within the template, based on the front matter variable is to, select one of those files and return the data contained in them.
If I do this:
site.data.footer.1
it returns the data withn 1.yml. If I try to do site.data.footer.{{page.footer}}
it returns nothing, even if the front matter has the footer variable set to 1 like this:
---
footer: 1
---
{% assign foot_id = page.footer %}
{{foot_id}}
{% assign stuff = site.data.footer.{{foot_id}} %}
{{stuff}}
stuff
in this case would be blank. Is this the correct way to do this? Whats going wrong?