{% comment %}
    This page creates a single 'chip' for linking to a project. 
    It expects the name of the project as the 'project' variable
{% endcomment %}

{% capture purl %}/projects/{{include.project}}/{% endcapture %}
{% assign pp = site.pages | where: "url", purl | first %}

{% if pp %}
    <a href="{{ site.baseurl }}{{purl}}">
        <div class="chip">
            {% if pp.logo %}
                <img src="{{ site.baseurl }}/{{pp.logo}}"/>
            {% endif %}
            {{pp.shorttitle}}
        </div>
    </a>
{% else %}
    <div class="chip">
        {{include.project}}
    </div>
{% endif %}