Skip to content

feat: implement image management system#44

Open
yoghi wants to merge 73 commits intomasterfrom
image-management
Open

feat: implement image management system#44
yoghi wants to merge 73 commits intomasterfrom
image-management

Conversation

@yoghi
Copy link
Copy Markdown
Contributor

@yoghi yoghi commented May 4, 2026

  • Add image management system design spec
  • Add image management implementation plan
  • feat: add event type configuration (epppi, campo-eg, stage)
  • feat: add ambientazione configuration (momo, star-trek, star-wars, monkey-island)
  • feat: add generic featured image for posts without events
  • feat: add liquid logic for featured image selection (event_type + ambientazione)
  • feat: add liquid logic for featured image selection (event_type + ambientazione)
  • fix: add backward compatibility for relative featured image paths
  • feat: add liquid logic for volantino selection (event_type + year)
  • feat: add event_type and year to existing event files
  • feat: add placeholder generator script for events and posts
  • Add image specs validation script
  • feat: add placeholder image check script
  • feat: add image validation job to CI workflow
  • feat: add image management makefile targets (generate, check, optimize)
  • fix: add missing optimize-generic target to match spec
  • docs: add comprehensive image creation and optimization guide
  • docs: clarify file paths and add mkdir prerequisite in IMAGE_GUIDE
  • test: verify end-to-end image management integration

yoghi added 19 commits May 4, 2026 16:42
- Frontmatter-based event type and ambientazione
- Liquid layouts with fallback logic
- Node scripts for placeholder generation/validation
- CI/CD integration for image specs enforcement
- Automatic optimization in build process

Spec written and committed to docs/superpowers/specs/2026-05-04-image-management-design.md
13 tasks covering:
- YAML config files (eventi, ambientazioni)
- Liquid layout logic for automatic image selection
- Node.js scripts (generate, check, validate)
- Makefile targets for automation
- CI/CD integration
- Complete documentation

Each task includes TDD steps, verification, and commit instructions.
Handle both relative paths (images/filename.jpg) and absolute paths
(/assets/images/filename.jpg) in the featured field.

Existing blog posts use relative paths without leading /assets/, so we
now prepend /assets/ only when the path doesn't contain /.
Implements validation for image dimensions and file sizes:
- Volantini: 3508×4961px, max 500KB
- Featured: 1200×630px, max 200KB
- Generic: 1200×630px, max 300KB

Validates images against specifications and reports errors.
Integrates with CI workflow to catch incorrect images before deployment.
Add script to detect 1x1 pixel placeholder images in locandina and featured images. This prevents deployment with placeholders and ensures real images are used.

Features:
- Scans src/jekyll/assets/images recursively
- Checks locandina_* and *-featured.* images
- Uses sharp to read image dimensions
- Exits with error if placeholders found
- Lists all placeholder files for easy fixing

Related to Task 2 of image management plan.
Adds check-image-placeholders job that:
- Sets up Node.js environment
- Installs sharp and js-yaml dependencies
- Runs check-image-placeholders.js to find placeholder images
- Runs validate-image-specs.js to verify image dimensions and file sizes
- Comments on PR with guidance if issues are found

This completes the image management system integration by catching
image issues before deployment.
- Add 'Percorsi dei File' section explaining source vs served paths
- Clarify that source path is src/jekyll/assets/images/ (where you edit)
- Clarify that served path is /assets/images/ (what Jekyll serves)
- Add mkdir -p before copy command to ensure directory exists
- Prevent confusion about which path to use in different contexts

Fixes code quality review issues:
- Issue 1: Path inconsistency between examples and actual structure
- Issue 2: Missing mkdir -p prerequisite before copy command
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Image Issues Found

Sostituisci placeholder o correggi specifiche:

  • Volantini: 3508×4961px (A3), max 500KB
  • Featured: 1200×630px (16:9), max 200KB

Vedi log per dettagli completi.

📖 Guida: docs/IMAGE_GUIDE.md

yoghi added 10 commits May 4, 2026 23:39
- Convert PNG source files to JPG before optimization
- Only convert if JPG missing or PNG newer
- Maintains PNG source for editing
- JPG optimized for production (1200x630, quality 85)
- site.static_files contains objects, not strings
- Iterate and compare paths for proper existence check
- Fixes fallback to generic-featured.png when file exists
yoghi and others added 28 commits May 4, 2026 22:38
Locked files listed in .locked were being converted according to category
rules instead of being copied as-is. The issue was that the locked file
check only matched the full relative path (e.g., 'root/generic-featured.png')
but the .locked file listed only the filename (e.g., 'generic-featured.png').

Fixed by checking both the full relative path and the filename basename
when determining if a file is locked.
- Add check-matrici-sync job to validate-pr.yml workflow
- Create check-matrici-sync.js script to verify matrici → assets sync
- Fix optimize-with-manifest.js rules parsing and category matching
- Add support for images conversion and proper handling
- Remove old apple-touch-icon files (now generated from SVG)
- Clean up obsolete optimize scripts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Image Issues Found

Sostituisci placeholder o correggi specifiche:

  • Volantini: 3508×4961px (A3), max 500KB
  • Featured: 1200×630px (16:9), max 200KB

Vedi log per dettagli completi.

📖 Guida: docs/IMAGE_GUIDE.md

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Matrici/Images Out of Sync

Le immagini in src/matrici/images/ non sono sincronizzate con src/jekyll/assets/images/

Soluzione:

make optimize-images
git add src/jekyll/assets/images/
git commit -m "chore: sync assets from matrici"

Vedi docs/IMAGE_GUIDE.md per dettagli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant