From 24fdf9dda0e1bf6789f32d90b4583b6ea03acdc5 Mon Sep 17 00:00:00 2001 From: TheJoeCoder <joe@radialbog9.uk> Date: Sun, 7 Jul 2024 12:29:01 +0100 Subject: [PATCH] Sort reversed to start with --- build_site.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build_site.py b/build_site.py index ef592e8..a3ebce7 100644 --- a/build_site.py +++ b/build_site.py @@ -21,7 +21,7 @@ shutil.copytree("static", "public/", dirs_exist_ok=True) # Load projects projects = [] files = os.listdir("templates/projects") -files.sort() +files.sort(reverse=True) for filename in files: filepath = os.path.join("templates", "projects", filename) if os.path.isfile(filepath) and filepath.endswith(".json"): @@ -38,8 +38,6 @@ for filename in files: # Add to projects projects.append(project) -projects.reverse() # Reverse items so newest is at the top - # Format template template = env.get_template("index.html") with open("public/index.html", "w") as f: -- GitLab