mirror of
https://github.com/github/awesome-copilot.git
synced 2026-05-01 04:35:55 +00:00
Simplify website search and listing controls (#1553)
* Removing search from the home pageThis was a little confusing because there are two searches, but the overall site search is a lot more powerful * Prefilter website search by resource page Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * small error handling and formatting * Simplify website listing controls Remove per-page text search, trim page-specific controls, and move remaining sort/filter controls into compact flyouts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -354,50 +354,6 @@ function generateInstructionsData(gitDates) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Categorize a skill based on its name and description
|
||||
*/
|
||||
function categorizeSkill(name, description) {
|
||||
const text = `${name} ${description}`.toLowerCase();
|
||||
|
||||
if (text.includes("azure") || text.includes("appinsights")) return "Azure";
|
||||
if (
|
||||
text.includes("github") ||
|
||||
text.includes("gh-cli") ||
|
||||
text.includes("git-commit") ||
|
||||
text.includes("git ")
|
||||
)
|
||||
return "Git & GitHub";
|
||||
if (text.includes("vscode") || text.includes("vs code")) return "VS Code";
|
||||
if (
|
||||
text.includes("test") ||
|
||||
text.includes("qa") ||
|
||||
text.includes("playwright")
|
||||
)
|
||||
return "Testing";
|
||||
if (
|
||||
text.includes("microsoft") ||
|
||||
text.includes("m365") ||
|
||||
text.includes("workiq")
|
||||
)
|
||||
return "Microsoft";
|
||||
if (text.includes("cli") || text.includes("command")) return "CLI Tools";
|
||||
if (
|
||||
text.includes("diagram") ||
|
||||
text.includes("plantuml") ||
|
||||
text.includes("visual")
|
||||
)
|
||||
return "Diagrams";
|
||||
if (
|
||||
text.includes("nuget") ||
|
||||
text.includes("dotnet") ||
|
||||
text.includes(".net")
|
||||
)
|
||||
return ".NET";
|
||||
|
||||
return "Other";
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate skills metadata
|
||||
*/
|
||||
@@ -405,15 +361,13 @@ function generateSkillsData(gitDates) {
|
||||
const skills = [];
|
||||
|
||||
if (!fs.existsSync(SKILLS_DIR)) {
|
||||
return { items: [], filters: { categories: [], hasAssets: ["Yes", "No"] } };
|
||||
return { items: [], filters: { hasAssets: ["Yes", "No"] } };
|
||||
}
|
||||
|
||||
const folders = fs
|
||||
.readdirSync(SKILLS_DIR)
|
||||
.filter((f) => fs.statSync(path.join(SKILLS_DIR, f)).isDirectory());
|
||||
|
||||
const allCategories = new Set();
|
||||
|
||||
for (const folder of folders) {
|
||||
const skillPath = path.join(SKILLS_DIR, folder);
|
||||
const metadata = parseSkillMetadata(skillPath);
|
||||
@@ -422,8 +376,6 @@ function generateSkillsData(gitDates) {
|
||||
const relativePath = path
|
||||
.relative(ROOT_FOLDER, skillPath)
|
||||
.replace(/\\/g, "/");
|
||||
const category = categorizeSkill(metadata.name, metadata.description);
|
||||
allCategories.add(category);
|
||||
|
||||
// Get all files in the skill folder recursively
|
||||
const files = getSkillFiles(skillPath, relativePath);
|
||||
@@ -440,7 +392,6 @@ function generateSkillsData(gitDates) {
|
||||
folder,
|
||||
metadata.name,
|
||||
relativePath,
|
||||
category,
|
||||
]
|
||||
.join(" ")
|
||||
.toLowerCase();
|
||||
@@ -453,7 +404,6 @@ function generateSkillsData(gitDates) {
|
||||
assets: metadata.assets,
|
||||
hasAssets: metadata.assets.length > 0,
|
||||
assetCount: metadata.assets.length,
|
||||
category: category,
|
||||
path: relativePath,
|
||||
skillFile: skillFilePath,
|
||||
files: files,
|
||||
@@ -468,7 +418,6 @@ function generateSkillsData(gitDates) {
|
||||
return {
|
||||
items: sortedSkills,
|
||||
filters: {
|
||||
categories: Array.from(allCategories).sort(),
|
||||
hasAssets: ["Yes", "No"],
|
||||
},
|
||||
};
|
||||
@@ -976,9 +925,7 @@ async function main() {
|
||||
|
||||
const skillsData = generateSkillsData(gitDates);
|
||||
const skills = skillsData.items;
|
||||
console.log(
|
||||
`✓ Generated ${skills.length} skills (${skillsData.filters.categories.length} categories)`
|
||||
);
|
||||
console.log(`✓ Generated ${skills.length} skills`);
|
||||
|
||||
const pluginsData = generatePluginsData(gitDates);
|
||||
const plugins = pluginsData.items;
|
||||
|
||||
Reference in New Issue
Block a user