Skip to content

Commit 8f1944d

Browse files
teggrCopilot
andauthored
Copilot/add date added field (#62)
* Initial plan * Add dateAdded field and implement recently added sorting with segmented button controls - Add dateAdded field to all markdown files (derived from git commit dates) - Implement gridByDate() for sorting by most recent additions - Replace single toggle button with segmented control (Alphabetical, Platform, Recently Added) - Add CSS styling for segmented button group with active states - Generate grid-by-date.html partial for recently added view - State is retained when navigating back from project/tag pages via history Co-authored-by: teggr <837787+teggr@users.noreply.github.com> * Separate sort buttons from hero section and make alphabetical default - Move sort button group out of hero-left section into dedicated sort-controls-section - Position sort buttons between hero and project grid for better visual hierarchy - Remove github-cta-container wrapper, place Contribute button directly under title - Change default sort from Platform to Alphabetical - Update indexPage to show gridAlphabeticalContent by default - Add CSS for .sort-controls-section with centered layout and spacing - Update hero-left .github-cta styles without container wrapper - All three sort options tested and working correctly Co-authored-by: teggr <837787+teggr@users.noreply.github.com> * Fix mobile responsiveness: stack sort buttons vertically and center contribute button - Add mobile responsive styles for .sort-button-group (max-width 640px) - Stack buttons vertically with flex-direction: column - Set max-width: 320px for better mobile presentation - Update .sort-btn for mobile with full width and left-aligned content - Increase vertical padding for easier tap targets - Center .hero-left .github-cta button on mobile (max-width 768px) - Display as block with 100% width and centered text - Desktop layout remains unchanged - All button functionality tested and working correctly Co-authored-by: teggr <837787+teggr@users.noreply.github.com> * Center title and contribute button in hero-left container - Add text-align: center to .hero-left on large screens (≥1024px) - Centers both title and contribute button within hero-left container - Add text-align: center to .hero-left on mobile/tablet (≤768px) - Centers both title and contribute button on smaller screens - Maintain responsive behavior across all viewport sizes - Button remains inline-block on desktop, block on mobile Co-authored-by: teggr <837787+teggr@users.noreply.github.com> * Update dateAdded field for multiple UI frameworks to reflect new dates * Add instructions for generating thumbnails and rebuilding the site * Refactor thumbnail name generation logic for consistency --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: teggr <837787+teggr@users.noreply.github.com>
1 parent 179649e commit 8f1944d

15 files changed

Lines changed: 29 additions & 31 deletions

.github/skills/capture-screenshot/SKILL.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,28 @@ After capturing, inform the user:
145145
- Format: PNG
146146
```
147147
148+
### 7. Generate Thumbnails (Post-Capture)
149+
150+
After adding a new image to the `images/` directory, generate thumbnails so the site can use optimized versions.
151+
152+
```bash
153+
jbang GenerateThumbnails.java
154+
```
155+
156+
**Notes:**
157+
- The script creates `thumbnail-{name}.png` with a max height of 540px.
158+
- It skips unchanged images using hash tracking.
159+
160+
### 8. (Optional) Rebuild the Site
161+
162+
If you want to preview the updated image and thumbnail locally, rebuild the site after generating thumbnails:
163+
164+
```bash
165+
jbang run build.java
166+
```
167+
168+
---
169+
148170
## Tool Selection Guide
149171
150172
Choose the appropriate tool based on availability:
@@ -251,31 +273,4 @@ This skill integrates with the add-project skill:
251273
2. After determining the project's URL (learnMoreHref field)
252274
3. Use this skill to automatically capture the screenshot
253275
4. Reference the image in the markdown front matter: `image: images/ui-{project}.png`
254-
255-
**Manual Fallback**: If automated screenshot capture fails:
256-
1. Manually open the URL in a browser
257-
2. Resize window to approximately 1280x800px
258-
3. Use browser's built-in screenshot tool or OS screenshot tool
259-
4. Save as PNG with correct naming in images folder
260-
261-
## Best Practices
262-
263-
1. **Consistent Sizing**: Always use same viewport dimensions (1280x800px recommended)
264-
2. **Wait for Load**: Allow sufficient time for page to fully render
265-
3. **Check Quality**: Verify screenshot is clear and representative
266-
4. **Optimize Files**: Keep PNG files under 500KB when possible
267-
5. **Update Regularly**: Re-capture screenshots when projects rebrand or update their websites
268-
6. **Backup URLs**: Keep note of the URL and date captured for reference
269-
270-
## Requirements
271-
272-
**Tool Requirements** (choose one):
273-
- Node.js 16+ (for Playwright or pageres-cli)
274-
- Python 3.8+ (for shot-scraper)
275-
- Internet connection for accessing websites
276-
277-
**Project Requirements**:
278-
- Valid project URL
279-
- Write access to `/images/` folder
280-
- Confirmation from user if overwriting existing image
281-
276+
5. Run `jbang GenerateThumbnails.java` to generate the thumbnail

GenerateThumbnails.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ void main(String... args) throws IOException, NoSuchAlgorithmException {
4747
currentHashes.put(fileName, imageHash);
4848

4949
// Determine thumbnail filename
50-
String thumbnailName = "thumbnail-" + fileName.substring(fileName.lastIndexOf('-') + 1);
50+
String thumbnailBaseName = fileName.startsWith("ui-")
51+
? fileName.substring("ui-".length())
52+
: fileName.substring(fileName.lastIndexOf('-') + 1);
53+
String thumbnailName = "thumbnail-" + thumbnailBaseName;
5154
Path thumbnailPath = imagesDir.resolve(thumbnailName);
5255

5356
// Check if thumbnail needs to be generated

build.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,10 @@ private static String getThumbnailUrl(String originalImageUrl) {
241241
return originalImageUrl;
242242
}
243243

244-
// Extract the filename after the last dash (e.g., "ui-casciian.png" -> "casciian.png")
244+
// Extract the filename after the last slash (e.g., "ui-casciian.png" -> "ui-casciian.png")
245245
String filename = originalImageUrl.substring(originalImageUrl.lastIndexOf('/') + 1);
246246
if (filename.startsWith("ui-")) {
247-
String thumbnailName = "thumbnail-" + filename.substring(filename.lastIndexOf('-') + 1);
247+
String thumbnailName = "thumbnail-" + filename.substring("ui-".length());
248248
String thumbnailUrl = "images/" + thumbnailName;
249249

250250
// Check if thumbnail exists

images/thumbnail-avaje-jex.png

85.3 KB
Loading

images/thumbnail-avaje-webview.png

96.8 KB
Loading
110 KB
Loading

images/thumbnail-codename-one.png

91.8 KB
Loading

images/thumbnail-domino-ui.png

56.3 KB
Loading

images/thumbnail-eclipse-rcp.png

95.2 KB
Loading
126 KB
Loading

0 commit comments

Comments
 (0)