From 910a13396f7ad67ba41402285780a9e28146b618 Mon Sep 17 00:00:00 2001
From: Dominik George <dominik.george@teckids.org>
Date: Tue, 12 Mar 2024 13:30:47 +0100
Subject: [PATCH] Stabilise order of projects

---
 content/projekte/hack-n-fun/_index.md |  2 ++
 content/projekte/indiedact/_index.md  |  2 ++
 content/projekte/schul-frei/_index.md |  2 ++
 templates/menu/projects.html          | 18 +++++++++---------
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/content/projekte/hack-n-fun/_index.md b/content/projekte/hack-n-fun/_index.md
index 0ea49f16..68821415 100644
--- a/content/projekte/hack-n-fun/_index.md
+++ b/content/projekte/hack-n-fun/_index.md
@@ -2,6 +2,8 @@
 title = "Hack'n'Fun"
 template = "project.html"
 
+weight = 10
+
 [extra]
 logo = "artwork/logo-hacknfun.svg"
 project_slug = "hack-n-fun"
diff --git a/content/projekte/indiedact/_index.md b/content/projekte/indiedact/_index.md
index c498b7ad..bdd2c55d 100644
--- a/content/projekte/indiedact/_index.md
+++ b/content/projekte/indiedact/_index.md
@@ -2,6 +2,8 @@
 title = "Indiedact"
 template = "project.html"
 
+weight = 30
+
 [extra]
 logo = "artwork/logo-leopard.svg"
 project_slug = "indiedact"
diff --git a/content/projekte/schul-frei/_index.md b/content/projekte/schul-frei/_index.md
index f6bbae28..b5ba5f9d 100644
--- a/content/projekte/schul-frei/_index.md
+++ b/content/projekte/schul-frei/_index.md
@@ -2,6 +2,8 @@
 title = "schul-frei"
 template = "project.html"
 
+weight = 20
+
 [extra]
 logo = "artwork/logo-schul-frei.svg"
 project_slug = "schul-frei"
diff --git a/templates/menu/projects.html b/templates/menu/projects.html
index 5b844640..5f68dc6f 100644
--- a/templates/menu/projects.html
+++ b/templates/menu/projects.html
@@ -1,17 +1,17 @@
-{% set projects = get_taxonomy(kind = "projekt") %}
+{% set projects_section = get_section(path="projekte/_index.md") %}
 
 <div class="container is-fluid">
   <div class="columns">
-    {% for project in projects.items %}
-    <section class="column menu-project-section" id="menu-project-section-{{ project.slug }}">
-      {% set section = get_section(path = "projekte/" ~ project.slug ~
-      "/_index.md") %}
-      <h1 class="title is-6 is-mega-menu-title"><a href="{{ section.permalink }}">
-          <p> {{ section.title }} </p>
-          <p class="is-4">{{ section.description }}</p>
+    {% for project_section_path in projects_section.subsections %}
+      {% set project_section = get_section(path=project_section_path) %}
+      {% set project_taxonomy = get_taxonomy_term(kind="projekt", term=project_section.title) %}
+      <section class="column menu-project-section" id="menu-project-section-{{ project_taxonomy.slug }}">
+          <h1 class="title is-6 is-mega-menu-title"><a href="{{ project_section.permalink }}">
+          <p> {{ project_section.title }} </p>
+          <p class="is-4">{{ project_section.description }}</p>
         </a></h1>
 
-      {% for page in project.pages %}
+      {% for page in project_taxonomy.pages %}
       <a class="navbar-item" href="{{ page.permalink }}">
         <div class="navbar-content">{{ page.title }}</div>
       </a>
-- 
GitLab