diff --git a/templates/threads.html b/templates/threads.html index 5483bd1..7df6983 100644 --- a/templates/threads.html +++ b/templates/threads.html @@ -61,16 +61,22 @@ & .ellipsis::after { content: '...' } + & .body { - & img, & video, & p { - margin-bottom: 1em; - } + & img, & video { + margin-bottom: 5px; + } - & img, & video { - border-radius: 5px; - max-width: 100%; - object-fit: cover; - border: 1px solid rgba(34, 34, 34, 0.15); + & p { + margin-bottom: 1em; + } + + & img, & video, & .link_card { + border-radius: 5px; + max-width: 100%; + object-fit: cover; + border: 1px solid rgba(34, 34, 34, 0.15); + } } & .author a { @@ -79,6 +85,11 @@ &:hover { text-decoration: underline; } + + & .emoji { + display: inline; + width: 1rem; + } } & .meta { @@ -100,6 +111,13 @@ cursor: pointer; margin-top: 1em; } + + & .link_card { + & strong, & em, & small { + display: block; + } + padding: 1em; + } } .card_avatar img { @@ -140,21 +158,24 @@

- +

- {{thread.content | safe}} +
+ {{thread.content | safe}} + + {% for media in thread.media_attachments %} + {% if media.type == 'image'%} + + {% elif media.type == 'gifv' %} + + {% endif %} + {% endfor %} +
- {% for media in thread.media_attachments %} - {% if media.type == 'image'%} - - {% elif media.type == 'gifv' %} - - {% endif %} - {% endfor %} {% if thread.descendants %}
@@ -171,17 +192,33 @@
- {{ descendant.content | safe }} - {% for media in descendant.media_attachments%} - {% if media.type == 'image'%} - - {% elif media.type == 'gifv' %} - +
+ {{ descendant.content | safe }} + {% for media in descendant.media_attachments%} + {% if media.type == 'image'%} + + {% elif media.type == 'gifv' %} + + {% endif %} + {% endfor %} + + {% if descendant.card %} + + + {% endif %} - {% endfor %} +
+ diff --git a/threads.py b/threads.py index dcc46a0..c355ee2 100755 --- a/threads.py +++ b/threads.py @@ -5,7 +5,7 @@ threads = Blueprint('threads', __name__, template_folder='template') # TODO: move following to an app config or sqlite ######### server = 'https://social.ayco.io' -thread_ids = ['112319729193615365', '112258065967208438'] +thread_ids = ['112319729193615365', '112258065967208438', '109545132056133905'] app = { "title":"Ayo's Threads", "description": "Release candidate for thoughts before they become a blog." @@ -64,6 +64,11 @@ def get_descendants(server, status): return descendants def clean_author(account): + if 'emojis' in account and len(account['emojis']) > 0: + name = account['display_name'] + for emoji in account['emojis']: + account['display_name'] = name.replace(":" + emoji['shortcode'] + ":", '') + return clean_dict(account, ['avatar', 'display_name', 'id', 'url']) def clean_status(status):