re-add rss feeds

This commit is contained in:
2026-06-10 22:30:53 +03:00
parent 50c61da8b6
commit bf3028e7d6
9 changed files with 113 additions and 12 deletions

View File

@@ -0,0 +1,21 @@
{% from 'common/macros.html' import rss_html_content %}
{%- extends 'base.atom' -%}
{%- block title -%}latest threads in {{topic.name | escape}}{%- endblock -%}
{%- block canonical_link -%}{{ url_for('topics.topic_by_id', topic_id=topic.id, _external=true) }}{%- endblock -%}
{%- block content -%}
<subtitle>{{ topic.description | escape }}</subtitle>
{%- for thread in threads_list -%}
<entry>
<title>{{ thread.title | escape }}</title>
<link href="{{ url_for('threads.thread_by_id', thread_id=thread.id, _external=true) }}"/>
<link rel="replies" type="application/atom+xml" href="{{ url_for('threads.feed', thread_id=thread.id, _external=true) }}"/>
<id>{{ url_for('threads.thread_by_id', thread_id=thread.id, _external=true) }}</id>
{{ rss_html_content(thread.original_post_content) }}
<updated>{{ thread.created_at | iso8601 }}</updated>
<author>
<name>{{ thread.started_by_display_name | escape }} @{{ thread.started_by }}</name>
<uri>{{ url_for('users.user_page', username=thread.started_by, _external=true) }}</uri>
</author>
</entry>
{%- endfor -%}
{%- endblock -%}

View File

@@ -20,7 +20,7 @@
<a href="{{url_for('topics.feed', topic_id=topic.id)}}" class="linkbutton rss">Subscribe via RSS</a>
<form method="GET">
<select name="sort_by">
<option value="activity"{% if sort_by == 'activity' %}selected{% endif %}>Sorted by activity</option>
<option value="activity" {% if sort_by == 'activity' %}selected{% endif %}>Sorted by activity</option>
<option value="thread" {% if sort_by == 'thread' %}selected{% endif %}>Sorted by newest</option>
</select>
<input type="submit" value="Sort">