preload all guide titles

This commit is contained in:
vcoppe
2024-09-23 15:21:01 +02:00
parent c02d96e90f
commit bcc29480c7
7 changed files with 48 additions and 37 deletions

View File

@@ -48,7 +48,7 @@ export async function handle({ event, resolve }) {
const stringsHTML = page === 'app' ? stringsToHTML(strings) : '';
const response = await resolve(event, {
transformPageChunk: ({ html }) => html.replace('<html>', htmlTag).replace('<head>', headTag).replace('<body data-sveltekit-preload-data="hover">', `<body data-sveltekit-preload-data="hover"><div class="hidden">${stringsHTML}</div>`)
transformPageChunk: ({ html }) => html.replace('<html>', htmlTag).replace('<head>', headTag).replace('</body>', `<div class="fixed -z-10 text-transparent">${stringsHTML}</div></body>`)
});
return response;