switch HTML feed to template

for #265
pull/292/head
Ryan Barrett 2022-11-17 07:58:08 -08:00
rodzic 4e0fb6536c
commit dbf4712af4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 30 dodań i 12 usunięć

Wyświetl plik

@ -130,13 +130,10 @@ def feed(domain):
'url': f'https://{domain}',
}
title = f'Bridgy Fed feed for {domain}'
extra = '<link rel="stylesheet" href="/static/feed.css" type="text/css" />'
if not as1_activities:
extra += '\n<p>Nothing yet. Follow more people, check back soon!</p>'
if format == 'html':
return microformats2.activities_to_html(as1_activities, extra=extra,
body_class='h-feed')
entries = [microformats2.object_to_html(a) for a in as1_activities]
return render_template('feed.html', **locals())
elif format == 'atom':
body = atom.activities_to_atom(as1_activities, actor=actor, title=title,
request_url=request.url)

Wyświetl plik

@ -0,0 +1,21 @@
{% extends "base.html" %}
{% block title %}{{ domain }}'s feed - Bridgy Fed{% endblock %}
{% block content %}
<h2 class="row">
<a href="/user/{{ domain }}">🌐 {{ domain }}</a>'s feed
</h2>
<br>
<link rel="stylesheet" href="/static/feed.css" type="text/css" />
<div class="row h-feed">
{% for e in entries %}
{{ e|safe }}
{% else %}
Nothing yet. <a href="/#To+use+it">Follow more people</a>, check back soon!
{% endfor %}
</div>
{% endblock %}