From 36c8b29f3e24c9185166c5c62661d2d9b671ace6 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 10 Feb 2020 22:40:20 -0800 Subject: [PATCH] Adds author bios --- fedireads/templates/author.html | 4 ++++ fedireads/templatetags/fr_display.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/fedireads/templates/author.html b/fedireads/templates/author.html index 7c54361e..191ad6ba 100644 --- a/fedireads/templates/author.html +++ b/fedireads/templates/author.html @@ -4,6 +4,10 @@

{{ author.data.name }}

+ {% if author.data.bio %} +
{{ author.data.bio | author_bio }} +
+ {% endif %} {% for book in books %}
{% include 'snippets/book.html' with book=book size=large description=True %} diff --git a/fedireads/templatetags/fr_display.py b/fedireads/templatetags/fr_display.py index a112b436..9beec01d 100644 --- a/fedireads/templatetags/fr_display.py +++ b/fedireads/templatetags/fr_display.py @@ -26,3 +26,9 @@ def description_format(description): description = description.split('----------')[0] return description.strip() + +@register.filter(name='author_bio') +def bio_format(bio): + ''' clean up OL author bios ''' + bio = bio.split('\n') + return bio[0].strip()