From fd507bee98e977ccce13f3da18f93d74de35acc7 Mon Sep 17 00:00:00 2001 From: Bartosz Spyrko-Smietanko Date: Fri, 3 Nov 2023 11:57:00 +0000 Subject: [PATCH] [#383] Add author picture to the blog post --- _layouts/post.html | 29 ++++++++++++++++++++++++++++- _sass/global.scss | 5 +++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/_layouts/post.html b/_layouts/post.html index 23640ac7..92482fe5 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -6,10 +6,37 @@

{{page.title}}

{% assign author = "" | split: ',' %} + {% assign has_avatar = "false" %} {% for a in page.author %} {% assign author = author | push: site.data.authors[a].name %} + {% if site.data.authors[a].avatar != nil %} + {% assign has_avatar = "true" %} + {% endif %} {% endfor %} - + +

+ {% if has_avatar == "true" %} + {% for a in page.author %} + {% assign author_data = site.data.authors[a] %} +

+ {% endfor %} + {% else %} + + {% endif %} +

{{ content }} diff --git a/_sass/global.scss b/_sass/global.scss index 60906344..4ce83b6d 100644 --- a/_sass/global.scss +++ b/_sass/global.scss @@ -111,6 +111,11 @@ p.byline { line-height: 1.8rem; } +img.avatar { + vertical-align:middle; + border-radius: 50%; +} + a { line-height: 1.5rem; font-weight: 400;