feat(image): enhance image handling with new properties and responsive support
Deploy / verify (push) Successful in 41s
Deploy / deploy (push) Successful in 1m2s

- Updated PostEntry type to include _rawImageUrl and _imageFocal for improved image management.
- Refactored image handling in various components to utilize the new properties, ensuring better focal point support and responsive image rendering.
- Introduced warmResponsiveImage function for pre-fetching image variants to optimize loading performance.
- Replaced CmsImage component with RustyImage in multiple blocks for consistent image processing.
This commit is contained in:
Peter Meier
2026-04-18 08:43:17 +02:00
parent 3c6ff773ae
commit a2f2d5bfb0
14 changed files with 297 additions and 162 deletions
+16 -4
View File
@@ -258,7 +258,14 @@ export async function loadPostsList(opts: {
focalX: field.focal?.x,
focalY: field.focal?.y,
});
(post as PostEntry & { _resolvedImageUrl?: string })._resolvedImageUrl = url;
const p = post as PostEntry & {
_resolvedImageUrl?: string;
_rawImageUrl?: string;
_imageFocal?: { x: number; y: number } | null;
};
p._resolvedImageUrl = url;
p._rawImageUrl = field.url;
p._imageFocal = field.focal ?? null;
} catch {
/* image optional */
}
@@ -440,9 +447,14 @@ export async function resolvePostOverviewBlocks(
focalX: field.focal?.x,
focalY: field.focal?.y,
});
(
post as PostEntry & { _resolvedImageUrl?: string }
)._resolvedImageUrl = url;
const p = post as PostEntry & {
_resolvedImageUrl?: string;
_rawImageUrl?: string;
_imageFocal?: { x: number; y: number } | null;
};
p._resolvedImageUrl = url;
p._rawImageUrl = field.url;
p._imageFocal = field.focal ?? null;
} catch {
// Bild optional
}