Hero from the CMS: markers HERO-HTML and HERO-PRELOAD, hero key in the data block, picture per ratio, baked fallback
The prerendered hero is plain HTML between the markers (first photo, h1, buttons), the slider takes over after hydration with the hero of the host block, the API or the build. The head preload is added to the finished HTML. Hero texts move into nl.json. The stand-in host and the e2e tests cover the hero. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -155,7 +155,13 @@ describe.each(priorityPages)('prioriteitsfoto van %s', (path) => {
|
||||
for (const node of body.querySelectorAll('noscript')) node.remove();
|
||||
const prioritized = [
|
||||
...body.querySelectorAll('img[fetchpriority="high"][src]'),
|
||||
].filter((image) => !image.closest('picture'));
|
||||
// The hero photo sits in a <picture> but has no <source> for the
|
||||
// baked page, so its preload is the plain one (config/heroPreload)
|
||||
].filter(
|
||||
(image) =>
|
||||
!image.closest('picture') ||
|
||||
image.classList.contains('cms-hero-image'),
|
||||
);
|
||||
expect(prioritized.length).toBeGreaterThan(0);
|
||||
for (const image of prioritized) {
|
||||
const links = preloads(document).filter(
|
||||
|
||||
Reference in New Issue
Block a user