diff --git a/website/src/hooks.server.js b/website/src/hooks.server.js index 049a2ea82..33de71f7e 100644 --- a/website/src/hooks.server.js +++ b/website/src/hooks.server.js @@ -35,9 +35,24 @@ export async function handle({ event, resolve }) { `; } + let stringsHTML = stringsToHTML(strings); + const response = await resolve(event, { - transformPageChunk: ({ html }) => html.replace('', head) + transformPageChunk: ({ html }) => html.replace('', head).replace('', ``) }); return response; +} + +function stringsToHTML(dictionary, strings = new Set(), root = true) { + Object.values(dictionary).forEach((value) => { + if (typeof value === 'object') { + stringsToHTML(value, strings, false); + } else { + strings.add(value); + } + }); + if (root) { + return Array.from(strings).map((string) => `

${string}

`).join(''); + } } \ No newline at end of file