Closed AucT closed 1 month ago
The changes made to the companies.html
file focus on improving the handling of company logos through enhanced image processing. A new variable system is introduced to manage image retrieval and resizing more effectively. This results in clearer variable assignments and ensures that image attributes are only set when valid images are available, thereby increasing maintainability and reducing potential errors.
File Path | Change Summary |
---|---|
themes/beaver/layouts/partials/companies.html | Introduced variables $image and $resized for improved image handling and resizing logic. |
Objective | Addressed | Explanation |
---|---|---|
Provide height & width per images to optimize CLS (#34) | ✅ |
🐰 In the land of code so bright,
Logos now fit just right.
With width and height defined,
A stable layout we will find.
Hooray for images, clear and neat,
Our pages now look quite a treat! 🌟
themes/beaver/layouts/partials/companies.html (4)
`4-4`: **LGTM!** The change improves readability by assigning the result of `resources.GetMatch $tech.image` to a variable `$image` instead of using it directly in the conditional statement. --- `5-5`: **LGTM!** The change ensures that the resizing and attribute assignments are only executed if the image is available, preventing potential errors from attempting to access properties of a non-existent image. --- `6-6`: **LGTM!** The change improves readability by assigning the resized image to a variable `$resized` instead of using it directly in the `` tag. --- `8-11`: **LGTM!** The change ensures that the image dimensions are explicitly defined, which can enhance layout stability and performance.
@AucT are there other places without height and width? how have you checked?
Part of #34
Summary by CodeRabbit
New Features
Bug Fixes