diff --git a/tildes/tildes/models/topic/topic.py b/tildes/tildes/models/topic/topic.py index 221d075..f2f80a9 100644 --- a/tildes/tildes/models/topic/topic.py +++ b/tildes/tildes/models/topic/topic.py @@ -419,6 +419,11 @@ class Topic(DatabaseModel): """Return the permalink for this topic.""" return f"/~{self.group.path}/{self.topic_id36}/{self.url_slug}" + @property + def permalink_absolute(self) -> str: + """Return the absolute permalink for this topic (domain included).""" + return f"https://tildes.net{self.permalink}" + @property def is_text_type(self) -> bool: """Return whether this is a text topic.""" diff --git a/tildes/tildes/templates/topic_listing.atom.jinja2 b/tildes/tildes/templates/topic_listing.atom.jinja2 index 06f5150..2d8a245 100644 --- a/tildes/tildes/templates/topic_listing.atom.jinja2 +++ b/tildes/tildes/templates/topic_listing.atom.jinja2 @@ -10,11 +10,11 @@ {% for topic in topics %} <![CDATA[{{ topic.title }}]]> - https://tildes.net{{ topic.permalink }} + {{ topic.permalink_absolute }} {% if topic.is_link_type %} {% else %} - + {% endif %} {% endif %} -

Comments URL: https://tildes.net{{ topic.permalink }}

+

Comments URL: {{ topic.permalink_absolute }}

Votes: {{ topic.num_votes }}

Comments: {{ topic.num_comments }}

]]>
diff --git a/tildes/tildes/templates/topic_listing.rss.jinja2 b/tildes/tildes/templates/topic_listing.rss.jinja2 index 4baf187..505907f 100644 --- a/tildes/tildes/templates/topic_listing.rss.jinja2 +++ b/tildes/tildes/templates/topic_listing.rss.jinja2 @@ -15,7 +15,7 @@ {% if topic.is_link_type %} {{ topic.link }} {% else %} - {{ topic.permalink }} + {{ topic.permalink_absolute }} {% endif %} {% endif %} -

Comments URL: https://tildes.net{{ topic.permalink }}

+

Comments URL: {{ topic.permalink_absolute }}

Votes: {{ topic.num_votes }}

Comments: {{ topic.num_comments }}

]]>
{{ topic.user.username }} - {{ topic.permalink }} + {{ topic.permalink_absolute }} {{ topic.created_time.strftime("%a, %d %b %Y %T %z") }} {% endfor %}