Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 9, 2025

  • Analyzed the repository structure and build process
  • Built the current site and confirmed it's 1.3GB as reported
  • Identified that _site/assets/images (1.3GB) is the primary culprit
  • Found that fetch_image.js generates images at widths [null, 300, 720, 940, 1200]
  • Discovered that 'null' preserves original size (generating 2048px+ images) and 1200px images are also very large
  • Modified fetch_image.js to remove 'null' and 1200px widths, keeping only [300, 720, 940]
  • Rebuilt the site and measured dramatic size reduction: 1.3GB → 371MB (71% reduction)
  • Verified tarball size reduced to 329MB (was likely >1GB compressed before)
  • Tested recent blog posts to ensure images still display properly
  • Took screenshots showing images work correctly after optimization
  • Updated .gitignore to prevent future build artifacts from being committed

Results Summary

Massive size reduction achieved:

  • Uncompressed site: 1.3GB → 371MB (71% reduction)
  • Compressed tarball: 329MB (estimated 70%+ reduction from original)
  • Image files reduced: 1275 → 816 files

Solution:
Modified src/fetch_image.js to generate only necessary image sizes:

  • Before: widths: [null, 300, 720, 940, 1200] (original + 1200px + others)
  • After: widths: [300, 720, 940] (removed oversized variants)

The site max display width is 960px, so 1200px+ images were unnecessary and the 'null' (original size) was generating huge 2048px+ images.

Verification Screenshots

Homepage after optimization showing images load correctly:
Homepage

Blog post with sensor data visualization displaying properly:
Blog Post

Fixes #285.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@dannystaple
Copy link
Member

@copilot Can you try make your commits again, I've made the default .gitignore exclude tarballs and zips to prevent the error seen above.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Warnings Elapsed time
❌ ACTION actionlint 5 6 0 0.08s
✅ BASH bash-exec 1 0 0 0.0s
✅ BASH shellcheck 1 0 0 0.06s
⚠️ BASH shfmt 1 1 0 0.0s
❌ C cppcheck 8 8 0 0.3s
❌ CPP cppcheck 8 8 0 0.33s
✅ JSON npm-package-json-lint yes no no 0.43s
✅ JSON v8r 12 0 0 10.35s
❌ MARKDOWN markdown-link-check 740 218 0 954.81s
✅ REPOSITORY gitleaks yes no no 13.02s
✅ REPOSITORY git_diff yes no no 0.38s
❌ REPOSITORY grype yes 2 no 35.21s
✅ REPOSITORY secretlint yes no no 41.87s
✅ REPOSITORY syft yes no no 1.65s
✅ REPOSITORY trivy-sbom yes no no 3.18s
✅ REPOSITORY trufflehog yes no no 4.87s
✅ XML xmllint 1 0 0 188.45s
✅ YAML v8r 13 0 0 6.82s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@dannystaple dannystaple closed this Sep 9, 2025
@dannystaple dannystaple deleted the copilot/fix-285 branch September 9, 2025 21:55
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.

Why is the site artifact so big

2 participants