From 576aa83b349b4bac095b2c3cae5136108cbfd90f Mon Sep 17 00:00:00 2001 From: jesper <118400668+k1nsej@users.noreply.github.com> Date: Wed, 24 Jul 2024 15:14:34 +0200 Subject: [PATCH] Adjust sorting by slug --- compile.py | 7 +++++-- dist/more/updates.html | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/compile.py b/compile.py index 2099fb2..587b734 100644 --- a/compile.py +++ b/compile.py @@ -230,7 +230,7 @@ def generate_card(title, date, path, author, snippet, image): def generate_more_pages(pages, types): """ - Generates the 'More' pages for each type. + Generates the 'More' pages for each type, sorted by slug (title). """ def generate_list_item(title, date, path, author, snippet): return f""" @@ -243,9 +243,12 @@ def generate_list_item(title, date, path, author, snippet): for path_key, section_title in types.items(): more_page_content = f"

{section_title}

" + + # Filter and sort pages filtered_pages = [info for page, info in sorted(pages.items(), key=lambda x: x[1]['date'], reverse=True) if path_key in info['path']] + sorted_pages = sorted(filtered_pages, key=lambda x: x['title'].lower()) # Sort by title (slug) - for info in filtered_pages: + for info in sorted_pages: file_path = os.path.join(CONTENT_DIR, info['path'].replace('.html', '.md')) with open(file_path, 'r') as f: markdown_text = f.read() diff --git a/dist/more/updates.html b/dist/more/updates.html index 54d5f77..4873aa4 100644 --- a/dist/more/updates.html +++ b/dist/more/updates.html @@ -45,15 +45,9 @@

Updates

-
Update May 28, 2024
- Posted on May 28, 2024 by Jesper -

The Sims Team just published a new update! These are the key fixes: Dishes won't hide anymore; they'll be cleaned...

-
- -
-
Update June 6, 2024
- Posted on June 6, 2024 by Jesper -

This is a rather small update which primarily removes the bugs where you could get the items from the login...

+
Update April 16, 2024
+ Posted on April 16, 2024 by Jesper +

These are the key fixes in the Update from April 16, 2024. Base Game: Alive plants will no longer emit...

@@ -63,9 +57,15 @@
Update July 24, 2024
-
Update April 16, 2024
- Posted on April 16, 2024 by Jesper -

These are the key fixes in the Update from April 16, 2024. Base Game: Alive plants will no longer emit...

+
Update June 6, 2024
+ Posted on June 6, 2024 by Jesper +

This is a rather small update which primarily removes the bugs where you could get the items from the login...

+
+ +
+
Update May 28, 2024
+ Posted on May 28, 2024 by Jesper +

The Sims Team just published a new update! These are the key fixes: Dishes won't hide anymore; they'll be cleaned...