From a6aaa9eec375f690a09c7e45ebc54d48104b5722 Mon Sep 17 00:00:00 2001 From: Ryder McMinn Date: Sat, 15 Jul 2017 06:04:55 -0400 Subject: [PATCH] Add Cover for Single Author's Page (#10) * Single Author Cover -- using AUTHORS_BIO config * author cover image in http://{site_url}/author/{author_name} page --- templates/author.html | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/templates/author.html b/templates/author.html index 50f8865..eb1bd1f 100644 --- a/templates/author.html +++ b/templates/author.html @@ -2,6 +2,18 @@ {% block title %}{{ SITENAME }} - Articles by {{ author }}{% endblock %} + +{% if AUTHORS_BIO and author.name.lower() in AUTHORS_BIO %} + {% set author_avatar = AUTHORS_BIO[author.name.lower()].image %} + {% if author_avatar %} + {% if author_avatar|lower|truncate(4, True, '') == "http" %} + {% set author_avatar = author_avatar %} + {% else %} + {% set author_avatar = SITEURL+"/"+author_avatar %} + {% endif %} + {% endif %} +{% endif %} + {% block opengraph %} {{ super() }} @@ -30,7 +42,11 @@ Menu - {% if HEADER_COVER %} + {% if AUTHORS_BIO and author.name.lower() in AUTHORS_BIO %} + {% if author_avatar %} +
+ {% endif %} + {% elif HEADER_COVER %}
{% elif HEADER_COLOR %}
@@ -44,17 +60,10 @@