From ec2c14f649be54e43c9ae7c5cd26eff16bff02f8 Mon Sep 17 00:00:00 2001 From: MatPoliquin Date: Sun, 29 Sep 2024 06:09:07 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Farama-F?= =?UTF-8?q?oundation/stable-retro@aaee218be998ae47b4e6720e6df83f85314434a6?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/.buildinfo | 2 +- main/_static/versioning/versioning_menu.html | 35 ++++++++++++++------ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/main/.buildinfo b/main/.buildinfo index d8e0682da..d07838950 100644 --- a/main/.buildinfo +++ b/main/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: f4a395eb501f4d4b1510e90b4508b321 +config: e315f20b6a6756231742a0ad46717336 tags: d77d1c0d9ca2f4c8421862c7c5a0d620 diff --git a/main/_static/versioning/versioning_menu.html b/main/_static/versioning/versioning_menu.html index 1daf4cef7..7a20036bd 100644 --- a/main/_static/versioning/versioning_menu.html +++ b/main/_static/versioning/versioning_menu.html @@ -122,15 +122,30 @@ }); const sortVersions = (a, b) => { - // Alpha versions - if (a.includes("a")) return 1; - if (b.includes("a")) return -1; - if (a.replace("v", "") > b.replace("v", "")) - return -1 - else if (a.replace("v", "") < b.replace("v", "")) - return 1 - else - return 0 + const normVersionNames = (a) => { + return a.replace("v", "").split(""); + }; + const innerA = normVersionNames(a); + const innerB = normVersionNames(b); + + while (innerA.length && innerB.length) { + const charA = innerA.shift(); + const charB = innerB.shift(); + + if (charA === charB) continue; + else if (charA === ".") return 1; + else if (charB === ".") return -1; + else if (charA.match(/[0-9]/) && charB.match(/[0-9]/)) { + return Number(charB) - Number(charA); + } else { + if (charA < charB) return 1; + else if (charA > charB) return -1; + else return 0; + } + } + if (innerA < innerB) return 1; + else if (innerA > innerB) return -1; + else return 0; } if ((githubUser !== null && githubUser !== "") || (repo !== null && repo !== "")) { @@ -204,4 +219,4 @@ console.error("Invalid versioning configuration"); } - \ No newline at end of file +