Converts all PNG images in website/ to WebP format to reduce repository size and improve page load performance#934
Converts all PNG images in website/ to WebP format to reduce repository size and improve page load performance#934VelmiraS wants to merge 7 commits into
website/ to WebP format to reduce repository size and improve page load performance#934Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for gardener-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thank you! Could you please follow the instructions for signing the Contributor License Agreement. You only have to do it once ;) |
klocke-io
left a comment
There was a problem hiding this comment.
Nice, thanks for pushing this topic,
Could we add a mini check on CI for PR`s that we do not allow assets over a reasonable size, maybe check what is recommended for this? 1MB is probably quite large.
Also, we should add this transformation to the build pipeline in Netlify after we pull the rest of the content through DocForge. We then need to use a different target, though.
There was a problem hiding this comment.
Okay, wow 😳 that change in tone is quite dramatic 😅 whereas in the image above, I feel like the change is not noticeable.
Maybe for the first step we just exclude them and covert them to jpg for the time being
| // Parse args | ||
| const DRY_RUN = !process.argv.includes('--write') | ||
| const dirArg = process.argv.find((a, i) => process.argv[i - 1] === '--dir') | ||
| const TARGET_DIR = join(ROOT, dirArg ?? 'website') |
There was a problem hiding this comment.
| const TARGET_DIR = join(ROOT, dirArg ?? 'website') | |
| const TARGET_DIR = join(ROOT, dirArg ?? 'website')Add a comment on line R23Add diff commentMarkdown input: edit mode selected.WritePreviewAdd a suggestionHeadingBoldItalicQuoteCodeLinkMore Formatting tools itemsSaved replies```suggestion | |
| ```Add FilesPaste, drop, or click to add filesCancelCommentStart a review | |
| // Only convert PNG files — JPG/JPEG are photos that lose quality when re-compressed | |
| const CONVERTIBLE = ['.png'] | |
| const SKIP_BELOW_KB = 5 | |
| // These files must stay as PNG — browsers require specific formats for them | |
| const SKIP_FILENAMES = new Set([ | |
| 'favicon.png', | |
| 'favicon-16x16.png', | |
| 'favicon-32x32.png', | |
| 'favicon-96x96.png', | |
| 'apple-touch-icon.png', | |
| 'web-app-manifest-192x192.png', | |
| 'web-app-manifest-512x512.png', | |
| ]) |
How about we extract those configurations to the make file and call the script/scripts from there, so that the scripts stay independent from our project 🤗
This would make it easier to package them and reuse them later.
There was a problem hiding this comment.
The two scripts have been merged into one as suggested. The configuration has also been moved to the Makefile, so the script stays project-independent.
- Convert 252 PNG files to WebP (quality 85) - Keep JPG/JPEG photos unchanged (no re-compression quality loss) - Update all .md/.vue references to use .webp - Skip favicons and web manifest icons (must stay PNG) - Add scripts/optimize-assets.mjs for future conversions - Add scripts/update-asset-refs.mjs for updating references
e9441dd to
056b190
Compare
b963c12 to
ff89cab
Compare
897fabb to
bc62a2a
Compare
bc62a2a to
60f70ac
Compare
|
Adding label DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
klocke-io
left a comment
There was a problem hiding this comment.
/lgtm
thanks for bringing this in :)
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: klocke-io The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
LGTM label has been added. DetailsGit tree hash: a5c687a1ccf3117582919ed20b10ef33313ba0e7 |
What this PR does / why we need it:
Converts 252 PNG images in
website/to WebP format, reducing repositorysize by ~100MB (~70%). Also adds two reusable scripts for future asset
optimization and updates all markdown/vue references accordingly.
JPG/JPEG photos are intentionally kept unchanged — re-compressing them
causes visible quality loss.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Some PNG files in the repository are photographs saved as PNG instead of JPG
(e.g. hackathon group pictures like
2025-07.png,2025-06.png). Afterconverting to WebP at quality 85, these appear slightly washed out compared
to the originals.
Please advise on preferred approach: