mirror of
https://git.ari.lt/ari.lt/blog.ari.lt.git
synced 2025-02-04 09:39:25 +01:00
update @ Thu 7 Sep 16:57:24 EEST 2023
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
parent
c3134dbd40
commit
2e56e159b4
2 changed files with 9 additions and 3 deletions
File diff suppressed because one or more lines are too long
|
@ -1097,13 +1097,19 @@ def rss(config: typing.Dict[str, typing.Any]) -> int:
|
||||||
for slug, post in config["posts"].items():
|
for slug, post in config["posts"].items():
|
||||||
llog(f"adding {slug!r} to rss")
|
llog(f"adding {slug!r} to rss")
|
||||||
|
|
||||||
|
created: typing.Optional[float] = post.get("edited")
|
||||||
|
|
||||||
item: etree.Element = etree.SubElement(channel, "item")
|
item: etree.Element = etree.SubElement(channel, "item")
|
||||||
|
|
||||||
etree.SubElement(item, "title").text = post["title"]
|
etree.SubElement(item, "title").text = post["title"]
|
||||||
etree.SubElement(item, "link").text = (
|
etree.SubElement(item, "link").text = (
|
||||||
link := f"{config['blog']}/{os.path.join(config['posts-dir'], slug)}"
|
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(
|
etree.SubElement(item, "pubDate").text = datetime.datetime.utcfromtimestamp(
|
||||||
post["created"]
|
post["created"]
|
||||||
).strftime(ftime)
|
).strftime(ftime)
|
||||||
|
|
Loading…
Add table
Reference in a new issue