From 965e0e0fbcd21aa703235fa6ed1596c2b31429fb Mon Sep 17 00:00:00 2001 From: timurgordon Date: Tue, 17 Jan 2023 14:19:44 +0300 Subject: [PATCH] fix author images on news cards --- templates/partials/newsCard.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/partials/newsCard.html b/templates/partials/newsCard.html index d4f250bf2..42bc17c30 100644 --- a/templates/partials/newsCard.html +++ b/templates/partials/newsCard.html @@ -21,11 +21,14 @@
    - {% if featured.taxonomies.people %} - {% for author in featured.taxonomies.people %} + {% if post.taxonomies.people %} + {% for author in post.taxonomies.people %} {% set author_path = 'people/' ~ author ~ '/index.md' %} - {% set author = get_page(path=author_path) %} - {% set author_img = get_url(path='/' ~ author.relative_path | replace(from='_', to='-') | replace(from='index.md', to=author.extra.imgPath)) %} + {% set people = get_section(path="people/_index.md") %} + {% set pages_str = people.pages | json_encode() | as_str %} + {% if pages_str is containing(author) %} + {% set author = get_page(path=author_path) %} + {% set author_img = get_url(path='/' ~ author.relative_path | replace(from='_', to='-') | replace(from='index.md', to=author.extra.imgPath)) %}
  • {{ author.title }}
  • + {% endif %} {% endfor %} {% endif %}