Skip to content
Snippets Groups Projects
people_chip.html 556 B
Newer Older
  • Learn to ignore specific revisions
  • Tom Wiesing's avatar
    Tom Wiesing committed
    {% comment %}
        This page creates a single 'chip' for linking to a person. 
        It expects the username of the person as the 'person' variable
    {% endcomment %}
    
    Tom Wiesing's avatar
    Tom Wiesing committed
    {% capture purl %}/people/{{include.person}}/{% endcapture %}
    
    Tom Wiesing's avatar
    Tom Wiesing committed
    {% assign pp = site.pages | where: "url", purl | first %}
    
    Tom Wiesing's avatar
    Tom Wiesing committed
    {% if pp %}
        <a href="{{ site.baseurl }}{{purl}}">
            <div class="chip">
    
    Michael Kohlhase's avatar
    Michael Kohlhase committed
                <img src="{{ site.baseurl }}/{{pp.pic}}"/>
    
    Tom Wiesing's avatar
    Tom Wiesing committed
                {{pp.fullname}}
            </div>
        </a>
    {% else %}
    
    Tom Wiesing's avatar
    Tom Wiesing committed
        <div class="chip">
    
    Tom Wiesing's avatar
    Tom Wiesing committed
            {{include.person}}
    
    Tom Wiesing's avatar
    Tom Wiesing committed
        </div>
    
    Michael Kohlhase's avatar
    Michael Kohlhase committed
    {% endif %}