Skip to content

Commit 76ac13a

Browse files
aaronpowellCopilot
andauthored
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>
1 parent 0d7a5ad commit 76ac13a

29 files changed

Lines changed: 1157 additions & 1322 deletions

eng/generate-website-data.mjs

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -354,66 +354,20 @@ function generateInstructionsData(gitDates) {
354354
};
355355
}
356356

357-
/**
358-
* Categorize a skill based on its name and description
359-
*/
360-
function categorizeSkill(name, description) {
361-
const text = `${name} ${description}`.toLowerCase();
362-
363-
if (text.includes("azure") || text.includes("appinsights")) return "Azure";
364-
if (
365-
text.includes("github") ||
366-
text.includes("gh-cli") ||
367-
text.includes("git-commit") ||
368-
text.includes("git ")
369-
)
370-
return "Git & GitHub";
371-
if (text.includes("vscode") || text.includes("vs code")) return "VS Code";
372-
if (
373-
text.includes("test") ||
374-
text.includes("qa") ||
375-
text.includes("playwright")
376-
)
377-
return "Testing";
378-
if (
379-
text.includes("microsoft") ||
380-
text.includes("m365") ||
381-
text.includes("workiq")
382-
)
383-
return "Microsoft";
384-
if (text.includes("cli") || text.includes("command")) return "CLI Tools";
385-
if (
386-
text.includes("diagram") ||
387-
text.includes("plantuml") ||
388-
text.includes("visual")
389-
)
390-
return "Diagrams";
391-
if (
392-
text.includes("nuget") ||
393-
text.includes("dotnet") ||
394-
text.includes(".net")
395-
)
396-
return ".NET";
397-
398-
return "Other";
399-
}
400-
401357
/**
402358
* Generate skills metadata
403359
*/
404360
function generateSkillsData(gitDates) {
405361
const skills = [];
406362

407363
if (!fs.existsSync(SKILLS_DIR)) {
408-
return { items: [], filters: { categories: [], hasAssets: ["Yes", "No"] } };
364+
return { items: [], filters: { hasAssets: ["Yes", "No"] } };
409365
}
410366

411367
const folders = fs
412368
.readdirSync(SKILLS_DIR)
413369
.filter((f) => fs.statSync(path.join(SKILLS_DIR, f)).isDirectory());
414370

415-
const allCategories = new Set();
416-
417371
for (const folder of folders) {
418372
const skillPath = path.join(SKILLS_DIR, folder);
419373
const metadata = parseSkillMetadata(skillPath);
@@ -422,8 +376,6 @@ function generateSkillsData(gitDates) {
422376
const relativePath = path
423377
.relative(ROOT_FOLDER, skillPath)
424378
.replace(/\\/g, "/");
425-
const category = categorizeSkill(metadata.name, metadata.description);
426-
allCategories.add(category);
427379

428380
// Get all files in the skill folder recursively
429381
const files = getSkillFiles(skillPath, relativePath);
@@ -440,7 +392,6 @@ function generateSkillsData(gitDates) {
440392
folder,
441393
metadata.name,
442394
relativePath,
443-
category,
444395
]
445396
.join(" ")
446397
.toLowerCase();
@@ -453,7 +404,6 @@ function generateSkillsData(gitDates) {
453404
assets: metadata.assets,
454405
hasAssets: metadata.assets.length > 0,
455406
assetCount: metadata.assets.length,
456-
category: category,
457407
path: relativePath,
458408
skillFile: skillFilePath,
459409
files: files,
@@ -468,7 +418,6 @@ function generateSkillsData(gitDates) {
468418
return {
469419
items: sortedSkills,
470420
filters: {
471-
categories: Array.from(allCategories).sort(),
472421
hasAssets: ["Yes", "No"],
473422
},
474423
};
@@ -976,9 +925,7 @@ async function main() {
976925

977926
const skillsData = generateSkillsData(gitDates);
978927
const skills = skillsData.items;
979-
console.log(
980-
`✓ Generated ${skills.length} skills (${skillsData.filters.categories.length} categories)`
981-
);
928+
console.log(`✓ Generated ${skills.length} skills`);
982929

983930
const pluginsData = generatePluginsData(gitDates);
984931
const plugins = pluginsData.items;

website/astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export default defineConfig({
119119
components: {
120120
Head: "./src/components/Head.astro",
121121
Footer: "./src/components/Footer.astro",
122+
Search: "./src/components/Search.astro",
122123
},
123124
}),
124125
sitemap(),

0 commit comments

Comments
 (0)