Skip to content

Commit

Permalink
Deploying to gh-pages from @ aaee218 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
MatPoliquin committed Sep 29, 2024
1 parent be45a8c commit ec2c14f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion main/.buildinfo
Original file line number Diff line number Diff line change
@@ -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
35 changes: 25 additions & 10 deletions main/_static/versioning/versioning_menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 !== "")) {
Expand Down Expand Up @@ -204,4 +219,4 @@
console.error("Invalid versioning configuration");
}
</script>
</div>
</div>

0 comments on commit ec2c14f

Please sign in to comment.