Closed AucT closed 1 month ago
The changes introduce a new image handling mechanism in the blog post layout by replacing the existing logic with a call to a partial template, img-cropped.html
. This new partial processes images based on metadata, generating cropped and WebP versions while ensuring a responsive layout. The updates streamline the image rendering process and enhance the overall structure of the templates.
Files | Change Summary |
---|---|
themes/beaver/layouts/_default/list.html |
Replaced image retrieval logic with a call to blog/img-cropped.html , passing current page context and dimensions (150x150). |
themes/beaver/layouts/blog/list.html |
Updated image handling to utilize the new img-cropped.html partial for rendering images, simplifying the template structure. |
themes/beaver/layouts/partials/blog/img-cropped.html |
Introduced a new partial for responsive image rendering, including logic for cropping, resizing, and fallback to a placeholder image if no image is found. |
sequenceDiagram
participant User
participant Template
participant Partial
participant ImageResource
User->>Template: Request Blog Post
Template->>Partial: Call img-cropped.html
Partial->>ImageResource: Retrieve Image
alt Image Found
ImageResource-->>Partial: Return Image
Partial->>Template: Render Image
else No Image Found
Partial-->>Template: Return Placeholder Image
end
Template-->>User: Display Blog Post
🐰 In the meadow where bunnies play,
New images bloom in a vibrant display.
With crops and formats, oh what a sight,
A template so tidy, it feels just right!
Hooray for the changes, let’s hop with glee,
For our blog now shines, as bright as can be! 🌼
Summary by CodeRabbit
New Features
Bug Fixes