From 472f835f9abfd1c40b4ed5e9b9e2a6430b575805 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Sun, 3 Dec 2017 02:15:03 -0500 Subject: [PATCH] Implement AUTHOR_BIO "name" and "cover" fields. (#16) * Implement AUTHOR_BIO "name" and "cover" fields. In the theme readme, there's are "name" and "cover" fields in the AUTHOR_BIO example, but these two fields weren't implemented yet. Instead, the author page was displaying the author entry through the title Jinja2 filter (which doesn't work so well for surnames like mine, which contains multiple capital letters ;) ), and the cover image was being used for the avatar image. This change uses the "name" and "cover" fields for these, respectfully. The cover image on the author page will also gracefully fall back to the site default if an author cover isn't specified as well. * Correct name author name display in post loop * Set author name if author bio not set default author name string will be title and that can be override form auther bio name --- templates/article.html | 15 +++++++++------ templates/author.html | 30 ++++++++++++++++++------------ templates/authors.html | 9 +++++++-- templates/partials/loop.html | 8 ++++++-- 4 files changed, 40 insertions(+), 22 deletions(-) diff --git a/templates/article.html b/templates/article.html index 28a14f2..525e582 100644 --- a/templates/article.html +++ b/templates/article.html @@ -83,7 +83,11 @@ {% endif %} {% for author in article.authors %} - {{ author|title }} + {% set author_name = author.name | title %} + {% if AUTHORS_BIO and author.name.lower() in AUTHORS_BIO %} + {% set author_name = AUTHORS_BIO[author.name.lower()].name or author.name %} + {% endif %} + {{ author_name }} {% endfor %} | @@ -137,21 +141,20 @@ {% for author in article.authors %} {% if AUTHORS_BIO and author.name.lower() in AUTHORS_BIO %}