handing different types
This commit is contained in:
parent
d286cb1f70
commit
3b8e06d48c
@ -257,8 +257,8 @@ function extractDescription(filePath) {
|
|||||||
* @param {string} link - The relative link to the instructions or prompts file.
|
* @param {string} link - The relative link to the instructions or prompts file.
|
||||||
* @returns {string} - Markdown formatted badges for installation.
|
* @returns {string} - Markdown formatted badges for installation.
|
||||||
*/
|
*/
|
||||||
function makeBadges(link) {
|
function makeBadges(link, type) {
|
||||||
return `[](vscode:chat-prompt/install?url=https://raw.githubusercontent.com/github/awesome-copilot/main/${link}) [](vscode-insiders:chat-prompt/install?url=https://raw.githubusercontent.com/github/awesome-copilot/main/${link})`;
|
return `[](vscode:chat-${type}/install?url=https://raw.githubusercontent.com/github/awesome-copilot/main/${link}) [](vscode-insiders:chat-${type}/install?url=https://raw.githubusercontent.com/github/awesome-copilot/main/${link})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -287,7 +287,7 @@ function generateInstructionsSection(instructionsDir) {
|
|||||||
const customDescription = extractDescription(filePath);
|
const customDescription = extractDescription(filePath);
|
||||||
|
|
||||||
// Create badges for installation links
|
// Create badges for installation links
|
||||||
const badges = makeBadges(link);
|
const badges = makeBadges(link, "instruction");
|
||||||
|
|
||||||
if (customDescription && customDescription !== "null") {
|
if (customDescription && customDescription !== "null") {
|
||||||
// Use the description from frontmatter
|
// Use the description from frontmatter
|
||||||
@ -328,7 +328,7 @@ function generatePromptsSection(promptsDir) {
|
|||||||
const customDescription = extractDescription(filePath);
|
const customDescription = extractDescription(filePath);
|
||||||
|
|
||||||
// Create badges for installation links
|
// Create badges for installation links
|
||||||
const badges = makeBadges(link);
|
const badges = makeBadges(link, "prompt");
|
||||||
|
|
||||||
if (customDescription && customDescription !== "null") {
|
if (customDescription && customDescription !== "null") {
|
||||||
promptsContent += `| [${title}](${link}) | ${customDescription} | ${badges} |\n`;
|
promptsContent += `| [${title}](${link}) | ${customDescription} | ${badges} |\n`;
|
||||||
@ -377,7 +377,7 @@ function generateChatModesSection(chatmodesDir) {
|
|||||||
const customDescription = extractDescription(filePath);
|
const customDescription = extractDescription(filePath);
|
||||||
|
|
||||||
// Create badges for installation links
|
// Create badges for installation links
|
||||||
const badges = makeBadges(link);
|
const badges = makeBadges(link, "chatmode");
|
||||||
|
|
||||||
if (customDescription && customDescription !== "null") {
|
if (customDescription && customDescription !== "null") {
|
||||||
chatmodesContent += `| [${title}](${link}) | ${customDescription} | ${badges} |\n`;
|
chatmodesContent += `| [${title}](${link}) | ${customDescription} | ${badges} |\n`;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user