From 5eb3c26113f716a175347b54bff9684da98d9b11 Mon Sep 17 00:00:00 2001 From: vanten-s Date: Tue, 21 Nov 2023 12:22:28 +0100 Subject: [PATCH] Fixed articles --- main.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.py b/main.py index f7ba6e0..00273ce 100644 --- a/main.py +++ b/main.py @@ -21,6 +21,17 @@ def article_list(): return articles_base_html.format(elements="\n".join(elements)) +def article_list_working(): + article_paths = (pathlib.Path.cwd() / "feed_articles").glob("[0-9]*") + article_paths_sorted = sorted(article_paths, key=lambda x: x.name, reverse=True) + + metadatas = [(feed_generator.convert_markdown_to_html(path)[1], path.parts[-1]) for path in article_paths_sorted] + print(metadatas) + + elements = ['
  • {title} ({guid})
  • '.format(title=metadata[0]["title"][0], guid=metadata[1]) for metadata in metadatas] + + return articles_base_html.format(elements="\n".join(elements)) + def article(path): if not "?" in path: return article_list()