From 2a2a5f77b6833f72eebcc943b1820665c6b9c863 Mon Sep 17 00:00:00 2001 From: tiyn Date: Sat, 20 Apr 2024 18:34:51 +0200 Subject: [PATCH] fixed rss errors --- src/app.py | 3 ++- src/content.py | 8 +++++--- src/templates/feed.xml | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/app.py b/src/app.py index 3e05d09..8035d32 100644 --- a/src/app.py +++ b/src/app.py @@ -129,7 +129,8 @@ def feed(): content_string=content, title=TITLE, description=DESCRIPTION, - website=WEBSITE) + website=WEBSITE, + language=LANGUAGE) response = make_response(feed_xml) response.headers["Content-Type"] = "application/rss+xml" return response diff --git a/src/content.py b/src/content.py index 94cf959..1fbd909 100644 --- a/src/content.py +++ b/src/content.py @@ -159,6 +159,7 @@ def get_rss_string(): Returns: string: rss-string of everything that is in the ENTRY_DIR. """ + locale.setlocale(locale.LC_TIME, "en_US.UTF-8") path_ex = ENTRY_DIR content_string = "" if path.exists(path_ex): @@ -178,12 +179,13 @@ def get_rss_string(): "/index.html#" + filename + "\n" content_string += "" + \ datetime.fromtimestamp(os.path.getmtime(file)).strftime( - "%Y-%m-%d") + "\n" - content_string += "" + "%a, %d %b %Y %H:%M:%S") + " +0100\n" + content_string += "\n\n\n\n\n" for line in text: content_string += line - content_string += "\n" + content_string += "\n\n]]>\n\n" content_string += "\n" + locale.setlocale(locale.LC_TIME, LOCAL) return content_string diff --git a/src/templates/feed.xml b/src/templates/feed.xml index 7f88109..7bd010b 100644 --- a/src/templates/feed.xml +++ b/src/templates/feed.xml @@ -5,8 +5,8 @@ {{ title }} {{ description }} {{ language }} -{{ url_for('feed') }} - +{{ website }} + {% autoescape off %} {{ content_string }}