Skip to content

Commit

Permalink
chore(website): hardcode api href since vercel not always as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
homura committed Nov 24, 2023
1 parent 00b4647 commit 5c89612
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions website/versioning-branches.js
Original file line number Diff line number Diff line change
@@ -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",
}
)

0 comments on commit 5c89612

Please sign in to comment.