From 2fad5b051c75caa95abeb56303eeabe0d2b11152 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Sat, 15 Jun 2024 12:27:48 +0800 Subject: [PATCH] rss feed on hashtags #203 --- app/tag/routes.py | 8 ++++---- app/templates/tag/tag.html | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/tag/routes.py b/app/tag/routes.py index b843bed2..42f2c8a4 100644 --- a/app/tag/routes.py +++ b/app/tag/routes.py @@ -82,9 +82,9 @@ def show_tag_rss(tag): description = None og_image = None fg = FeedGenerator() - fg.id(f"https://{current_app.config['SERVER_NAME']}/tag/{tag}") - fg.title(f'#{Tag.display_as} on {g.site.name}') - fg.link(href=f"https://{current_app.config['SERVER_NAME']}/tag/{tag}", rel='alternate') + fg.id(f"https://{current_app.config['SERVER_NAME']}/tag/{tag.name}") + fg.title(f'#{tag.display_as} on {g.site.name}') + fg.link(href=f"https://{current_app.config['SERVER_NAME']}/tag/{tag.name}", rel='alternate') if og_image: fg.logo(og_image) else: @@ -93,7 +93,7 @@ def show_tag_rss(tag): fg.subtitle(description) else: fg.subtitle(' ') - fg.link(href=f"https://{current_app.config['SERVER_NAME']}/tag/{tag}/feed", rel='self') + fg.link(href=f"https://{current_app.config['SERVER_NAME']}/tag/{tag.name}/feed", rel='self') fg.language('en') for post in posts: diff --git a/app/templates/tag/tag.html b/app/templates/tag/tag.html index 3c010a4a..a651f237 100644 --- a/app/templates/tag/tag.html +++ b/app/templates/tag/tag.html @@ -61,6 +61,16 @@ {% endif %} +
+
+

{{ _('RSS') }}

+
+
+ +
+
{% include "_inoculation_links.html" %}