Newer
Older
Includes an image of a person on the page.
Assumes that there is a variable "person" already defined.
It holds a key "image" and an associated value which is a subpath to the
image file from the site's image directory (see _config.yml).
If the image could not be found for any reason, a default avatar image
will be substituted.
{%- assign person = include.person -%}
{%- if person -%}
{%- if person.image -%}
{%- assign image-url = site.directory.images
| append: person.image -%}
<img class="portrait"
src="{{ image-url | strip | relative_url }}"
alt="Picture of {{ person.name }}">
{%- else -%}
<div class="portrait"></div>
{%- endif -%}
{%- else -%}
<!--
WARNING: team_card/image.html was included,
but no person object was defined
-->