Compare commits
2 commits
dc1f2276b0
...
a243c30446
Author | SHA1 | Date | |
---|---|---|---|
vanten-s | a243c30446 | ||
vanten-s | 5eb3c26113 |
11
main.py
11
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 = ['<li><a href="articles.html?{guid}">{title} ({guid})</a></li>'.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()
|
||||
|
|
Loading…
Reference in a new issue