{% assign data = site.data[include.collection] %} {%- capture columns -%} {%- for field in data.first -%} { "title": "{{ field[0] }}", "data": "{{ field[0] }}" }{% unless forloop.last %}, {% endunless %} {%- endfor -%} {%- endcapture -%} {% comment %} {% assign first_item = site.data[include.collection].first %}
{% for field in first_item %}
{{ field[0] }}
{% endfor %}
{% for item in site.data[include.collection] %}
{% for value in item %} {% if value[0] == 'pid' %}
{{ value[1] }}
{% elsif value[1] contains '/img/derivatives/' %}
{{ value[1] | absolute_url }}
{% else %}
{{ value[1] }}
{% endif %} {% endfor %}
{% endfor %}
{% endcomment %}