From 58c6cd32f8b042e0b7857ad400ce47431ef1d389 Mon Sep 17 00:00:00 2001 From: timurgordon Date: Sun, 24 Jul 2022 21:29:51 +0200 Subject: [PATCH] add author taxonomy support to blog page & card --- templates/blogPage.html | 14 ++++++++++++-- templates/partials/postCard.html | 16 +++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/templates/blogPage.html b/templates/blogPage.html index dc4f09850..ac866753e 100644 --- a/templates/blogPage.html +++ b/templates/blogPage.html @@ -1,6 +1,11 @@ {% extends "_default/base.html" %} {% block content %} +{% if page.taxonomies.people %} + {% set author_path = 'people/' ~ page.taxonomies.people[0] ~ '/index.md' %} + {% set author = get_page(path=author_path) %} +{% endif %} +
@@ -19,7 +24,9 @@
  • - {{page.extra.author}}
  • + {% endif %}
-

{{ page.extra.author }}

+ {% if author %} +

{{ author.title }}

+ {% endif %}

diff --git a/templates/partials/postCard.html b/templates/partials/postCard.html index c32252d05..06d074fea 100644 --- a/templates/partials/postCard.html +++ b/templates/partials/postCard.html @@ -1,3 +1,8 @@ +{% if post.taxonomies.people %} + {% set author_path = 'people/' ~ post.taxonomies.people[0] ~ '/index.md' %} + {% set author = get_page(path=author_path) %} +{% endif %} +