diff --git a/index.html b/index.html index 306b4d8dc..5870aef2c 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,6 @@ type="text/css" /> - The Homebrewery - NaturalCrit diff --git a/server/app.js b/server/app.js index 48f82f634..1cb5f4169 100644 --- a/server/app.js +++ b/server/app.js @@ -576,6 +576,15 @@ export default async function createApp(vite) { userThemes : req.userThemes }; + const ogTags = []; + const ogMeta = req.ogMeta ?? {}; + Object.entries(ogMeta).forEach(([key, value])=>{ + if(!value) return; + const tag = ``; + ogTags.push(tag); + }); + const ogMetaTags = ogTags.join('\n'); + const htmlPath = isProd ? path.resolve('build', 'index.html') : path.resolve('index.html'); let html = fs.readFileSync(htmlPath, 'utf-8'); @@ -585,7 +594,7 @@ export default async function createApp(vite) { html = html.replace( '', - `\n` + `\n\n${ogMetaTags}` ); return html;