From c38fe30e4e33cc001958122e193f594578270a55 Mon Sep 17 00:00:00 2001
From: laurentheirendt <laurent.heirendt@uni.lu>
Date: Mon, 31 Jan 2022 14:19:23 +0100
Subject: [PATCH] fixes after testing

---
 .ci/generateIndex.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.ci/generateIndex.py b/.ci/generateIndex.py
index c27d9bd3..4dcff3ab 100644
--- a/.ci/generateIndex.py
+++ b/.ci/generateIndex.py
@@ -182,6 +182,9 @@ for folder in cardDirs:
                 indexS = sections.index(d)
                 maxOrder = 0
 
+                # reset the ordering array per section
+                orderArr[indexS] = []
+
                 if len(localIndexArr[indexS]) == 0:
                     localIndexArr[indexS] = ["\n"]
 
@@ -294,7 +297,7 @@ for folder in cardDirs:
 
                 # join all subcategories to the index
                 # if all subcategories have a predefined order
-                if len(orderArr[indexS]) == len(localIndexArr[indexS]) and len(orderArr[indexS]) > 0:
+                if len(orderArr[indexS]) <= len(localIndexArr[indexS]) and len(orderArr[indexS]) > 0:
                     X = localIndexArr[indexS][1:]
                     Y = orderArr[indexS]
                     localIndexArr[indexS] = [x for _, x in sorted(zip(Y, X))]
-- 
GitLab