mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-23 20:05:12 +00:00
Update redirect URLs for installation links (#216)
* Updated the redirect url * Update update-readme.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -242,14 +242,23 @@ const vscodeInsidersInstallImage =
|
||||
"https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white";
|
||||
const repoBaseUrl =
|
||||
"https://raw.githubusercontent.com/github/awesome-copilot/main";
|
||||
const vscodeBaseUrl = "https://vscode.dev/redirect?url=";
|
||||
const vscodeInsidersBaseUrl = "https://insiders.vscode.dev/redirect?url=";
|
||||
|
||||
// Map install types to aka.ms short links. Both VS Code and Insiders will use
|
||||
// the same aka.ms target; the redirect base (vscode vs insiders) is preserved
|
||||
// so VS Code or Insiders opens correctly but the installation URL is uniform.
|
||||
const AKA_INSTALL_URLS = {
|
||||
instructions: "https://aka.ms/awesome-copilot/install/instructions",
|
||||
prompt: "https://aka.ms/awesome-copilot/install/prompt",
|
||||
mode: "https://aka.ms/awesome-copilot/install/chatmode",
|
||||
};
|
||||
|
||||
function makeBadges(link, type) {
|
||||
return `[](${vscodeBaseUrl}${encodeURIComponent(
|
||||
`vscode:chat-${type}/install?url=${repoBaseUrl}/${link})`
|
||||
)}<br />[](${vscodeInsidersBaseUrl}${encodeURIComponent(
|
||||
`vscode-insiders:chat-${type}/install?url=${repoBaseUrl}/${link})`
|
||||
)}`;
|
||||
const aka = AKA_INSTALL_URLS[type] || AKA_INSTALL_URLS.instructions;
|
||||
|
||||
const vscodeUrl = `${aka}?url=${encodeURIComponent(`vscode:chat-${type}/install?url=${repoBaseUrl}/${link}`)}`;
|
||||
const insidersUrl = `${aka}?url=${encodeURIComponent(`vscode-insiders:chat-${type}/install?url=${repoBaseUrl}/${link}`)}`;
|
||||
|
||||
return `[](${vscodeUrl})<br />[](${insidersUrl})`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user