mirror of https://gitlab.com/tildes/tildes.git
Andrew Shu
4 years ago
committed by
Deimos
10 changed files with 148 additions and 1 deletions
-
4tildes/tildes/routes.py
-
14tildes/tildes/templates/base.atom.jinja2
-
3tildes/tildes/templates/base.jinja2
-
15tildes/tildes/templates/base.rss.jinja2
-
6tildes/tildes/templates/home.atom.jinja2
-
8tildes/tildes/templates/home.rss.jinja2
-
39tildes/tildes/templates/topic_listing.atom.jinja2
-
5tildes/tildes/templates/topic_listing.jinja2
-
37tildes/tildes/templates/topic_listing.rss.jinja2
-
18tildes/tildes/views/topic.py
@ -0,0 +1,14 @@ |
|||
{# Copyright (c) 2021 Tildes contributors <code@tildes.net> #} |
|||
{# SPDX-License-Identifier: AGPL-3.0-or-later #} |
|||
|
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<feed xmlns="http://www.w3.org/2005/Atom"> |
|||
|
|||
<title>{% block feed_title %}Tildes Atom feed{% endblock %}</title> |
|||
<id>{% block feed_id %}{{ request.current_route_url() }}{% endblock %}</id> |
|||
<link rel="self" href="{% block feed_link %}{{ request.current_route_url() }}{% endblock %}" /> |
|||
<updated>{% block feed_updated %}{{ current_time.strftime("%Y-%m-%dT%H:%M:%SZ") }}{% endblock %}</updated> |
|||
|
|||
{% block feed_entries %}{% endblock %} |
|||
|
|||
</feed> |
@ -0,0 +1,15 @@ |
|||
{# Copyright (c) 2021 Tildes contributors <code@tildes.net> #} |
|||
{# SPDX-License-Identifier: AGPL-3.0-or-later #} |
|||
|
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<rss version="2.0"> |
|||
|
|||
<channel> |
|||
<title>{% block channel_title %}Tildes{% endblock %}</title> |
|||
<link>{% block channel_link %}https://tildes.net/{% endblock %}</link> |
|||
<description>{% block channel_description %}Tildes RSS feed{% endblock %}</description> |
|||
|
|||
{% block channel_items %}{% endblock %} |
|||
</channel> |
|||
|
|||
</rss> |
@ -0,0 +1,6 @@ |
|||
{# Copyright (c) 2021 Tildes contributors <code@tildes.net> #} |
|||
{# SPDX-License-Identifier: AGPL-3.0-or-later #} |
|||
|
|||
{% extends 'topic_listing.atom.jinja2' %} |
|||
|
|||
{% block feed_title %}Tildes Atom feed{% endblock %} |
@ -0,0 +1,8 @@ |
|||
{# Copyright (c) 2021 Tildes contributors <code@tildes.net> #} |
|||
{# SPDX-License-Identifier: AGPL-3.0-or-later #} |
|||
|
|||
{% extends 'topic_listing.rss.jinja2' %} |
|||
|
|||
{% block channel_title %}Tildes{% endblock %} |
|||
{% block channel_link %}https://tildes.net/{% endblock %} |
|||
{% block channel_description %}Topics RSS feed{% endblock %} |
@ -0,0 +1,39 @@ |
|||
{# Copyright (c) 2021 Tildes contributors <code@tildes.net> #} |
|||
{# SPDX-License-Identifier: AGPL-3.0-or-later #} |
|||
|
|||
{% extends 'base.atom.jinja2' %} |
|||
|
|||
{% block feed_title %}~{{ group.path }} - Tildes{% endblock %} |
|||
|
|||
{% block feed_entries %} |
|||
|
|||
{% for topic in topics %} |
|||
<entry> |
|||
<title><![CDATA[{{ topic.title }}]]></title> |
|||
<id>https://tildes.net{{ topic.permalink }}</id> |
|||
{% if topic.is_link_type %} |
|||
<link rel="alternate" href="{{ topic.link }}"/> |
|||
{% else %} |
|||
<link rel="alternate" href="{{ topic.permalink }}"/> |
|||
{% endif %} |
|||
<content type="html"><![CDATA[ |
|||
{% if topic.is_link_type %} |
|||
<p>Link URL: <a href="{{ topic.link }}">{{ topic.link }}</a></p> |
|||
{% elif topic.is_text_type %} |
|||
{{ topic.rendered_html|safe }} |
|||
<hr/> |
|||
{% endif %} |
|||
<p>Comments URL: <a href="{{ topic.permalink }}">https://tildes.net{{ topic.permalink }}</a></p> |
|||
<p>Votes: {{ topic.num_votes }}</p> |
|||
<p>Comments: {{ topic.num_comments }}</p> |
|||
]]></content> |
|||
<author><name>{{ topic.user.username }}</name></author> |
|||
{% if topic.last_edited_time %} |
|||
<updated>{{ topic.last_edited_time.strftime("%Y-%m-%dT%H:%M:%SZ") }}</updated> |
|||
{% else %} |
|||
<updated>{{ topic.created_time.strftime("%Y-%m-%dT%H:%M:%SZ") }}</updated> |
|||
{% endif %} |
|||
</entry> |
|||
{% endfor %} |
|||
|
|||
{% endblock %} |
@ -0,0 +1,37 @@ |
|||
{# Copyright (c) 2021 Tildes contributors <code@tildes.net> #} |
|||
{# SPDX-License-Identifier: AGPL-3.0-or-later #} |
|||
|
|||
{% extends 'base.rss.jinja2' %} |
|||
|
|||
{% block channel_title %}~{{ group.path }} - Tildes{% endblock %} |
|||
{% block channel_link %}https://tildes.net/~{{ group.path }}{% endblock %} |
|||
{% block channel_description %}Topics in ~{{ group.path }}{% endblock %} |
|||
|
|||
{% block channel_items %} |
|||
|
|||
{% for topic in topics %} |
|||
<item> |
|||
<title><![CDATA[{{ topic.title }}]]></title> |
|||
{% if topic.is_link_type %} |
|||
<link>{{ topic.link }}</link> |
|||
{% else %} |
|||
<link>{{ topic.permalink }}</link> |
|||
{% endif %} |
|||
<description><![CDATA[ |
|||
{% if topic.is_link_type %} |
|||
<p>Link URL: <a href="{{ topic.link }}">{{ topic.link }}</a></p> |
|||
{% elif topic.is_text_type %} |
|||
{{ topic.rendered_html|safe }} |
|||
<hr/> |
|||
{% endif %} |
|||
<p>Comments URL: <a href="{{ topic.permalink }}">https://tildes.net{{ topic.permalink }}</a></p> |
|||
<p>Votes: {{ topic.num_votes }}</p> |
|||
<p>Comments: {{ topic.num_comments }}</p> |
|||
]]></description> |
|||
<author>{{ topic.user.username }}</author> |
|||
<comments>{{ topic.permalink }}</comments> |
|||
<pubDate>{{ topic.created_time.strftime("%a, %d %b %Y %T %z") }}</pubDate> |
|||
</item> |
|||
{% endfor %} |
|||
|
|||
{% endblock %} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue