---
# metadata for json export
---
{%- assign items = site.data[site.metadata] | where_exp: 'item','item.objectid' -%}
{%- assign fields = site.data.theme.metadata-export-fields | split: "," -%}
{ "objects": [
    {%- for item in items -%}
    { 
        {% for f in fields %}{% if item[f] %}{{ f | jsonify }}: {{ item[f] | jsonify }},{% endif %}
        {% endfor %}{% if item.image_thumb %}"object_thumb": "{{ item.image_thumb | absolute_url }}",{% endif %}
        "object_location": "{{ item.object_location | absolute_url }}",
        "reference_url": "{{ '/items/' | relative_url }}{% if item.parentid %}{{ item.parentid }}.html#{{ item.objectid }}{% else %}{{ item.objectid }}.html{% endif %}"
    }{% unless forloop.last %},{% endunless %}
    {% endfor %}
] }
