From 04bd81047e097af66d307520069be01ae7feafa6 Mon Sep 17 00:00:00 2001 From: Youri van Mill Date: Thu, 21 Dec 2023 13:25:41 +0100 Subject: [PATCH] fix: add teleports body element --- src/plugin/generateHtml.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugin/generateHtml.ts b/src/plugin/generateHtml.ts index 6e20b48..f940014 100644 --- a/src/plugin/generateHtml.ts +++ b/src/plugin/generateHtml.ts @@ -81,6 +81,12 @@ export async function generateHtml(template: string, $('body').append(``) } + const teleports = ctx.teleports ?? {} + + if (teleports['#teleports'] !== undefined) { + $('body').append(`
${teleports['#teleports']}
`) + } + const resolvedTags = await head.resolveTags() let tags = ['title', 'meta', 'link', 'base', 'style', 'script', 'noscript']