Skip to content

Commit 07d94c3

Browse files
authored
1 parent 5dfe8a3 commit 07d94c3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

convert_json.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,27 @@ def rss_item(title: str | None = None,
7373
with open(JSON_PATH, 'rb') as emails_json_file:
7474
json_data: dict = json.load(emails_json_file)
7575

76-
tree = ET.ElementTree(ET.Element("rss", {"version": "2.0"}))
76+
tree = ET.ElementTree(ET.Element(
77+
"rss",
78+
{"version": "2.0", "xmlns:atom": "http://www.w3.org/2005/Atom"}
79+
))
7780

7881
root = tree.getroot()
7982

8083
root.append(ET.Element("channel"))
8184
channel = root[0]
8285

8386
# Setup RSS metadata specifications
87+
# atom:link https://validator.w3.org/feed/docs/warning/MissingAtomSelfLink.html
8488
channel.extend([
8589
ET.Element("title"),
8690
ET.Element("link"),
8791
ET.Element("description"),
92+
ET.Element("atom:link", {
93+
"href": RSS_CHANNEL_LINK,
94+
"ref": "rel",
95+
"type": "application/rss+xml"
96+
}),
8897
])
8998
channel[0].text = RSS_CHANNEL_TITLE
9099
channel[1].text = RSS_CHANNEL_LINK

0 commit comments

Comments
 (0)