update @ Thu 7 Sep 16:57:24 EEST 2023

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
Ari Archer 2023-09-07 16:57:24 +03:00
parent c3134dbd40
commit 2e56e159b4
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: A50D5B4B599AF8A2
2 changed files with 9 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -1097,13 +1097,19 @@ def rss(config: typing.Dict[str, typing.Any]) -> int:
for slug, post in config["posts"].items():
llog(f"adding {slug!r} to rss")
created: typing.Optional[float] = post.get("edited")
item: etree.Element = etree.SubElement(channel, "item")
etree.SubElement(item, "title").text = post["title"]
etree.SubElement(item, "link").text = (
link := f"{config['blog']}/{os.path.join(config['posts-dir'], slug)}"
)
etree.SubElement(item, "description").text = post["description"]
etree.SubElement(item, "description").text = post["description"] + (
f" [edited at {datetime.datetime.utcfromtimestamp(created).strftime(ftime)}]"
if created
else ""
)
etree.SubElement(item, "pubDate").text = datetime.datetime.utcfromtimestamp(
post["created"]
).strftime(ftime)