Conversation
- 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
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults 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)
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 failed.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
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.
| @@ -0,0 +1,31 @@ | |||
| manifest: https://github.com/gardener/documentation/blob/master/.docforge/hugo.yaml | |||
| destination: hugo | |||
There was a problem hiding this comment.
Not sure why this file is marked as new 👀
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
There was a problem hiding this comment.
I think this file in particular is just unreasonably large. Maybe we can compress it to around 1 MB before converting it.
There was a problem hiding this comment.
I like the scripts, but I am not sure if we should tackle those two problems independently of each other, instead of going through the files, finding every reference and link, converting those images and then updating the reference. This obviously also has its edge cases, such as when an image is referenced in multiple files, etc.
But I think this could resolve the problem we are having with the preview deploy as well.
| // 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.
|
PR needs rebase. 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. |
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: