diff --git a/__init__.py b/__init__.py index f1bb03d..1664f2f 100644 --- a/__init__.py +++ b/__init__.py @@ -39,7 +39,9 @@ def article_to_xml(article_path: pathlib.Path): return base_item.format(tags="\n".join(tags)) def make_rss_feed(path, channel_name, channel_link, description): - articles = "".join([article_to_xml(path) for path in (pathlib.Path.cwd() / path).glob("*")]) + article_paths = (pathlib.Path.cwd() / path).glob("[0-9]*") + article_paths_sorted = sorted(article_paths, key=lambda x: x.name, reverse=True) + articles = "".join([article_to_xml(path) for path in article_paths_sorted]) return base_feed \ .replace("{title}", channel_name) \ .replace("{link}", channel_link) \