make pubdate nice

This commit is contained in:
Anish Lakhwara 2023-04-03 23:59:16 +10:00
parent e9dce2fe13
commit a785d208f9

View file

@ -8,7 +8,7 @@ import random
import platform
import re
import shutil
from datetime import datetime
from datetime import datetime, timezone, timedelta, tzinfo
# Default encoding
encoding = 'utf-8'
@ -541,8 +541,10 @@ def create_rss_feed(rss_entries, rss_template, rss_item_template, site_folder):
'rssItemTitle', rss_entry["title"])
entry_template = entry_template.replace('rssItemUrl', build_url
+ rss_entry["slug"])
date = datetime.strptime(rss_entry["iso_date"], "%y%m%d-%H%M")
date = date.strftime("%a, %d %b %Y %H:%M")
entry_template = entry_template.replace(
'rssItemDate', rss_entry["iso_date"])
'rssItemDate', date)
entry_template = entry_template.replace(
'rssItemContent', rss_entry["pageContent"])
rss_items += entry_template