Commit 2655f54f authored by Marien Fressinaud's avatar Marien Fressinaud

imp: Display last written articles at the bottom

When there are a lot of pages and articles, it's better to see the last
articles at the end so the user doesn't need to scroll to the top to
find its article.
parent f1891cd5
......@@ -136,16 +136,16 @@ def main(environment):
utils.write_content(page, output_path)
print(f"Written page: {page.url()}")
for feed in feeds:
utils.write_feed(feed, output_path)
print(f"Written feed: {feed.url()}")
articles_sorted = list(articles.values())
articles_sorted.sort(key=lambda article: article.date(), reverse=True)
articles_sorted.sort(key=lambda article: article.date())
for article in articles_sorted:
utils.write_content(article, output_path)
print(f"Written article: {article.url()}")
for feed in feeds:
utils.write_feed(feed, output_path)
print(f"Written feed: {feed.url()}")
# STEP 3: and we finish by copying the static folder.
static_dirpath = os.path.join(os.curdir, "static")
if os.path.isdir(static_dirpath):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment