mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-04 16:08:54 +00:00
Merge branch 'master' of https://github.com/naturalcrit/homebrewery into cleanup
This commit is contained in:
+4
-2
@@ -283,11 +283,13 @@ export default async function createApp(vite) {
|
||||
const safeProps = JSON.stringify(props).replace(/<(?=\/?script)/ig, '\\u003c');
|
||||
html = html.replace(
|
||||
'<head>',
|
||||
`<head>\n`
|
||||
()=>{ //Replace must use a function instead of string, else brews with `$` in contents are treated as replacement patterns
|
||||
return `<head>\n`
|
||||
+ `<script id="props">`
|
||||
+ `window.__INITIAL_PROPS__ = ${safeProps
|
||||
}</script>\n${
|
||||
ogMetaTags}`
|
||||
ogMetaTags}`;
|
||||
}
|
||||
);
|
||||
|
||||
return html;
|
||||
|
||||
Reference in New Issue
Block a user