Adds author bios

This commit is contained in:
Mouse Reeve 2020-02-10 22:40:20 -08:00
parent 964c56079c
commit 36c8b29f3e
2 changed files with 10 additions and 0 deletions

View file

@ -4,6 +4,10 @@
<div id="content">
<div>
<h2>{{ author.data.name }}</h2>
{% if author.data.bio %}
<blockquote>{{ author.data.bio | author_bio }}
</blockquote>
{% endif %}
{% for book in books %}
<div class="book-preview">
{% include 'snippets/book.html' with book=book size=large description=True %}

View file

@ -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()