From 10905d4b345b748a3fa87f4c631a42c28ce9e496 Mon Sep 17 00:00:00 2001 From: Tom Wiesing <tkw01536@gmail.com> Date: Tue, 31 May 2022 09:28:48 +0200 Subject: [PATCH] people: Hide images when they don't exist This commit updates the people_list page and people template to handle cases where a specific person does not have an assoicated image. --- _includes/people_list.html | 2 +- _layouts/person.html | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/_includes/people_list.html b/_includes/people_list.html index 50078c3..664156d 100644 --- a/_includes/people_list.html +++ b/_includes/people_list.html @@ -14,7 +14,7 @@ <h5>{{role.name}}(s)</h5></li> {% for person in rollers %} <li class="collection-item avatar"> - <img src="/{{person.pic}}" alt="" class="circle"/> + {% if person.pic %}<img src="/{{person.pic}}" alt="" class="circle"/>{% endif %} <a href="{{person.url}}" class="title">{{person.fullname}}</a> <p> {% if person.start_date %} diff --git a/_layouts/person.html b/_layouts/person.html index 9ac56da..e40f81e 100644 --- a/_layouts/person.html +++ b/_layouts/person.html @@ -9,7 +9,9 @@ layout: default <div class="col s12 m5 right"> <div class="card"> <div class="card-image"> - <img src="/{{page.pic}}" width="300"/> + {% if page.pic %} + <img src="/{{page.pic}}" width="300"/> + {% endif %} </div> <div class="card-content"> <span class="card-title">{{ page.fullname }}</span> -- GitLab