From 5c8961222d85143a0fa427e5855733b0ede7d384 Mon Sep 17 00:00:00 2001 From: homura Date: Fri, 24 Nov 2023 15:56:49 +0800 Subject: [PATCH] chore(website): hardcode api href since vercel not always as expected --- website/versioning-branches.js | 35 +++++++++------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/website/versioning-branches.js b/website/versioning-branches.js index 574567c52..1b1fd723c 100644 --- a/website/versioning-branches.js +++ b/website/versioning-branches.js @@ -1,27 +1,10 @@ -// string or { branchName: string, label: string } -const branches = [ - { - branchName: "stable", - label: "0.19.x(latest)", - }, - { - branchName: "develop", - label: "0.20.x(next)", - }, +/** + * + * @type {{href: string, label: string, target: string}[]} + */ +module.exports = [ + { label: "v0.19.0", href: "https://lumos-website-git-019-cryptape.vercel.app/api/", target: "_blank" }, + { label: "v0.20.0", href: "https://lumos-website-git-publish-0200-magickbase.vercel.app/api/", target: "_blank" }, + { label: "v0.21.0", href: "https://lumos-website-git-prepare-021-magickbase.vercel.app/api/", target: "_blank" }, + { label: "canary", href: "https://lumos-website.vercel.app/api/", target: "_blank" }, ] - -const parseURL = (branchName) => branchName.replaceAll("_", "").replaceAll(".", "").replaceAll("/", "-") - -module.exports = branches.map((branch) => - typeof branch === "string" - ? { - href: `https://lumos-website-git-${parseURL(branch)}-magickbase.vercel.app/api/`, - label: branch, - target: "_blank", - } - : { - href: `https://lumos-website-git-${parseURL(branch.branchName)}-magickbase.vercel.app/api/`, - label: branch.label, - target: "_blank", - } -)