Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions eng/generate-website-data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,76 @@ function generatePluginsData(gitDates) {
/**
* Generate canvas extensions metadata
*/
function getExtensionAssetInfo(extensionDir, relPath, ref) {
const assetDir = path.join(extensionDir, "assets");

if (!fs.existsSync(assetDir)) {
return null;
}

const imageExtensions = new Set([
".png",
".jpg",
".jpeg",
".webp",
".gif",
]);

const preferredNames = [
"preview.png",
"preview.jpg",
"preview.jpeg",
"preview.webp",
"preview.gif",
"screenshot.png",
"screenshot.jpg",
"screenshot.jpeg",
"screenshot.webp",
"screenshot.gif",
"image.png",
"image.jpg",
"image.jpeg",
"image.webp",
"image.gif",
];

for (const candidate of preferredNames) {
const candidatePath = path.join(assetDir, candidate);
if (fs.existsSync(candidatePath)) {
const assetPath = `${relPath}/assets/${candidate}`;
const encodedAssetPath = assetPath
.split("/")
.map((segment) => encodeURIComponent(segment))
.join("/");
return {
assetPath,
imageUrl: `https://raw.githubusercontent.com/github/awesome-copilot/${ref}/${encodedAssetPath}`,
};
Comment on lines +709 to +717
}
}

const files = fs
.readdirSync(assetDir)
.filter((file) => imageExtensions.has(path.extname(file).toLowerCase()))
.sort((a, b) => a.localeCompare(b));

if (files.length === 0) {
return null;
}

const assetFile = files[0];
const assetPath = `${relPath}/assets/${assetFile}`;
const encodedAssetPath = assetPath
.split("/")
.map((segment) => encodeURIComponent(segment))
.join("/");

return {
assetPath,
imageUrl: `https://raw.githubusercontent.com/github/awesome-copilot/${ref}/${encodedAssetPath}`,
};
}

function generateExtensionsData(gitDates, commitSha) {
const extensions = [];

Expand All @@ -683,12 +753,20 @@ function generateExtensionsData(gitDates, commitSha) {

for (const dir of extensionDirs) {
const relPath = `extensions/${dir.name}`;
const assetInfo = getExtensionAssetInfo(
path.join(EXTENSIONS_DIR, dir.name),
relPath,
commitSha
);

extensions.push({
id: dir.name,
name: formatDisplayName(dir.name),
path: relPath,
ref: commitSha,
lastUpdated: getDirectoryLastUpdated(gitDates, relPath),
imageUrl: assetInfo?.imageUrl || null,
assetPath: assetInfo?.assetPath || null,
});
}

Expand Down
8 changes: 8 additions & 0 deletions extensions/backlog-swipe-triage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Backlog Swipe Triage

Swipe-driven backlog triage canvas for reviewing open issues, applying quick decisions, and starting implementation sessions.

## Assets

- `assets/preview.png` — preferred screenshot path for the triage experience.
- `assets/swipe-canvas-triage.png` — existing reference screenshot kept for compatibility.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading