feat: added opengraph tags to homepage

pull/1/head
Antonio De Lucreziis 2 years ago
parent af8a760c12
commit d6fbbde329

@ -79,8 +79,12 @@ async function createProductionRouter() {
const fullUrl = `${req.protocol}://${req.get('host')}${req.originalUrl}`
const metaTagsHtml =
'' +
(metadata.title ? `<meta property="og:title" content="${metadata.title}" />\n` : '') +
(metadata.description ? `<meta property="og:description" content="${metadata.description}" />\n` : '') +
(metadata.title ? `<meta property="og:title" content="${metadata.title ?? 'PHC | Problemi'}" />\n` : '') +
(metadata.description
? `<meta property="og:description" content="${
metadata.description ?? 'Bacheca di problemi di matematica creato dal PHC'
}" />\n`
: '') +
`<meta property="og:url" content="${fullUrl}" />\n`
res.send(transformedTemplate.replace('<!-- INJECT META TAGS -->', metaTagsHtml).replace('<!-- SSR OUTLET -->', html))

Loading…
Cancel
Save