From 2ea0ba243726a914f005610541cf90ed90d1f6d5 Mon Sep 17 00:00:00 2001 From: Martin Danielsson Date: Wed, 24 Feb 2016 10:41:33 +0100 Subject: [PATCH] Fixed display of author names on post_by... pages. --- _layouts/post_by_category.html | 14 ++++++++++++-- _layouts/post_by_tag.html | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/_layouts/post_by_category.html b/_layouts/post_by_category.html index 057e4e2..05b4d05 100644 --- a/_layouts/post_by_category.html +++ b/_layouts/post_by_category.html @@ -39,7 +39,17 @@ layout: default {% endif %} {% endif %} --> - + {% if post.author %} + {% assign author = site.data.authors[post.author] %} + {% if author %} + {% assign author_name = author.name %} + {% else %} + {% assign author_name = post.author %} + {% endif %} + {% else %} + {% assign author_name = site.title %} + {% endif %} +

{{ post.title }} @@ -50,7 +60,7 @@ layout: default

{% endif %}
- +

diff --git a/_layouts/post_by_tag.html b/_layouts/post_by_tag.html index 073b9da..2139d30 100644 --- a/_layouts/post_by_tag.html +++ b/_layouts/post_by_tag.html @@ -39,7 +39,17 @@ layout: default {% endif %} {% endif %} --> - + {% if post.author %} + {% assign author = site.data.authors[post.author] %} + {% if author %} + {% assign author_name = author.name %} + {% else %} + {% assign author_name = post.author %} + {% endif %} + {% else %} + {% assign author_name = site.title %} + {% endif %} +

{{ post.title }} @@ -50,7 +60,7 @@ layout: default

{% endif %}
- +