Can a liquid for loop contain a page variable in Jekyll?
<p>Let's say I have a bunch of <code>_data</code> files that I use to create a list for specific pages. All of the pages that have these lists have a custom front matter variable of <code>pageName</code>. The value of <code>pageName</code> just so happens to match the <code>_data</code> file with the list.</p>

<p>Rather than pasting the html blocks of code into each page, I'd like to use an <code>include</code> to pull in a generic block of html. To do that, the include has to be dynamic or contain liquid markup to become dynamic.</p>

<p>That might be more context than you need, but my question boils down to this, is something like this possible:</p>

<pre><code>{% for item in site.data.{{page.pageName}} %}
  {{ item.label }}
{% endfor %}
</code></pre>

<p>Unless I'm missing something, this doesn't work so I'm wanting to know if there's a way of achieving similar functionality.</p>

<hr>

<p>I found <a href="https://stackoverflow.com/questions/7919644/using-liquid-variables-inside-of-a-liquid-tag-call">this similar question</a>, but it doesn't seem to answer whether it can be used to access a page variable to build a file name.</p>