Skip to content

Commit fa6a577

Browse files
solrevdevclaude
andcommitted
feat(blog): enhance winget search post with accurate cover image and code samples
- Remove irrelevant placeholder image from blog post body - Add accurate cover image matching real winget-search interface design - Update JavaScript code samples to reflect actual repository implementation - Replace fancy gradient design with clean, minimal interface representation - Improve technical accuracy of blog content 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d75990d commit fa6a577

File tree

2 files changed

+82
-15
lines changed

2 files changed

+82
-15
lines changed

_posts/2025-09-15-building-winget-search-a-fast-web-interface-for-winget-packages.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ layout: post
44
title: Building Winget Search - A fast web interface for Windows Package Manager
55
description: >-
66
How I built a GitHub Pages-hosted search interface for winget packages to solve my machine setup workflow
7+
cover_image: /images/winget-search-cover.svg
78
tags:
89
- python
910
- javascript
@@ -18,8 +19,6 @@ When setting up a new Windows machine, I used to rely on [Scoop](https://scoop.s
1819

1920
The problem? Finding winget package IDs was tedious. While `winget search` works, I wanted something faster - a web interface where I could quickly search, find packages, and copy installation commands. That's how [winget-search](https://github.com/solrevdev/winget-search) was born.
2021

21-
![Winget Search Interface](https://i.imgur.com/YLysmmV.png)
22-
2322
## The Challenge
2423

2524
Winget packages are stored in Microsoft's [winget-pkgs repository](https://github.com/microsoft/winget-pkgs) with over 30,000 YAML manifest files. The repository structure follows a pattern: `manifests/publisher/package_name/version/` with separate files for different locales and installers.
@@ -96,17 +95,22 @@ The search interface is pure vanilla JavaScript - no frameworks needed. It loads
9695
function showResults(query) {
9796
const q = query.trim().toLowerCase();
9897

99-
let results = packages.filter(pkg => {
100-
const idMatch = pkg.id?.toLowerCase().includes(q);
101-
const nameMatch = pkg.name?.toLowerCase().includes(q);
102-
const descMatch = pkg.description?.toLowerCase().includes(q);
103-
const publisherMatch = pkg.publisher?.toLowerCase().includes(q);
104-
const tagMatch = pkg.tags?.some(tag =>
105-
tag && typeof tag === 'string' && tag.toLowerCase().includes(q)
106-
);
107-
108-
return idMatch || nameMatch || descMatch || publisherMatch || tagMatch;
109-
}).slice(0, 100);
98+
let results;
99+
if (!q) {
100+
results = packages.slice(0, 50);
101+
} else {
102+
results = packages.filter(pkg => {
103+
const idMatch = pkg.id?.toLowerCase().includes(q);
104+
const nameMatch = pkg.name?.toLowerCase().includes(q);
105+
const descMatch = pkg.description?.toLowerCase().includes(q);
106+
const publisherMatch = pkg.publisher?.toLowerCase().includes(q);
107+
const tagMatch = pkg.tags?.some(tag =>
108+
tag && typeof tag === 'string' && tag.toLowerCase().includes(q)
109+
);
110+
111+
return idMatch || nameMatch || descMatch || publisherMatch || tagMatch;
112+
}).slice(0, 100);
113+
}
110114

111115
// Render results...
112116
}
@@ -117,8 +121,19 @@ Each search result includes a one-click copy button for the winget install comma
117121
```javascript
118122
function copyCommand(button, cmd) {
119123
navigator.clipboard.writeText(cmd).then(() => {
120-
button.innerHTML = 'Copied!';
121-
setTimeout(() => button.innerHTML = 'Copy', 2000);
124+
const originalHtml = button.innerHTML;
125+
button.classList.add('success');
126+
button.innerHTML = `
127+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
128+
<polyline points="20 6 9 17 4 12"/>
129+
</svg>
130+
Copied!
131+
`;
132+
133+
setTimeout(() => {
134+
button.classList.remove('success');
135+
button.innerHTML = originalHtml;
136+
}, 2000);
122137
});
123138
}
124139
```

images/winget-search-cover.svg

Lines changed: 52 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)