In foo.html (post), I have the following:
{% assign table_name="application" %} {% include table.html %}
This assignment works fine in table.html
{% assign tableName = table_name %} <p>table name is: {{ tableName }}</p> # renders "table name is: application"
Now I'm trying to sort the data array that I defined in config.yml by doing the following:
{% for header in site.table.tableName.headers %} <th>{{ header }}</th> {% endfor %}
It does not give me any result.
If I modify the for statement to include the contents of the variable, and not the variable, it works fine.
{% for header in site.table.application.headers %}
This makes me think that this is not a problem with my array, but that it is either a flaw in Jekyll, a bug in Jekyll, or I am not exactly constructing my statements.
Any idea how I could make this work?
source share