|
|
@ -48,13 +48,13 @@ async function createDevRouter(db: DatabaseConnection) {
|
|
|
|
const fullUrl = `https://${req.get('host')}${req.originalUrl}`
|
|
|
|
const fullUrl = `https://${req.get('host')}${req.originalUrl}`
|
|
|
|
const metaTagsHtml =
|
|
|
|
const metaTagsHtml =
|
|
|
|
'' +
|
|
|
|
'' +
|
|
|
|
(metadata.title ? `<meta property="og:title" content="${metadata.title ?? 'PHC | Problemi'}" />\n` : '') +
|
|
|
|
(metadata.title ? `<meta property="og:title" content="${metadata.title ?? 'PHC | Problemi'}">\n` : '') +
|
|
|
|
(metadata.description
|
|
|
|
(metadata.description
|
|
|
|
? `
|
|
|
|
? `
|
|
|
|
<meta name="description" content="${metadata.description}" />
|
|
|
|
<meta name="description" content="${metadata.description}">
|
|
|
|
<meta property="og:description" content="${metadata.description ?? 'Bacheca di problemi di matematica creato dal PHC'}" />\n`
|
|
|
|
<meta property="og:description" content="${metadata.description ?? 'Bacheca di problemi di matematica creato dal PHC'}">\n`
|
|
|
|
: '') +
|
|
|
|
: '') +
|
|
|
|
`<meta property="og:url" content="${fullUrl}" />\n`
|
|
|
|
`<meta property="og:url" content="${fullUrl}">\n`
|
|
|
|
|
|
|
|
|
|
|
|
res.send(transformedTemplate.replace('<!-- INJECT META TAGS -->', metaTagsHtml).replace('<!-- SSR OUTLET -->', html))
|
|
|
|
res.send(transformedTemplate.replace('<!-- INJECT META TAGS -->', metaTagsHtml).replace('<!-- SSR OUTLET -->', html))
|
|
|
|
} catch (error: any) {
|
|
|
|
} catch (error: any) {
|
|
|
@ -84,14 +84,14 @@ async function createProductionRouter(db: DatabaseConnection) {
|
|
|
|
const metaTagsHtml =
|
|
|
|
const metaTagsHtml =
|
|
|
|
'' +
|
|
|
|
'' +
|
|
|
|
(metadata.title
|
|
|
|
(metadata.title
|
|
|
|
? `<meta property="og:title" content="${metadata.title}" />\n`
|
|
|
|
? `<meta property="og:title" content="${metadata.title}">\n`
|
|
|
|
: `<meta property="og:title" content="PHC | Problemi" />\n`) +
|
|
|
|
: `<meta property="og:title" content="PHC | Problemi">\n`) +
|
|
|
|
(metadata.description
|
|
|
|
(metadata.description
|
|
|
|
? `<meta name="description" content="${metadata.description}" />
|
|
|
|
? `<meta name="description" content="${metadata.description}">
|
|
|
|
<meta property="og:description" content="${metadata.description}" />\n`
|
|
|
|
<meta property="og:description" content="${metadata.description}">\n`
|
|
|
|
: `<meta name="description" content="Bacheca di problemi di matematica creato dal PHC" />
|
|
|
|
: `<meta name="description" content="Bacheca di problemi di matematica creato dal PHC">
|
|
|
|
<meta property="og:description" content="Bacheca di problemi di matematica creato dal PHC" />\n`) +
|
|
|
|
<meta property="og:description" content="Bacheca di problemi di matematica creato dal PHC">\n`) +
|
|
|
|
`<meta property="og:url" content="${fullUrl}" />\n`
|
|
|
|
`<meta property="og:url" content="${fullUrl}">\n`
|
|
|
|
|
|
|
|
|
|
|
|
const finalHtml = transformedTemplate.replace('<!-- INJECT META TAGS -->', metaTagsHtml).replace('<!-- SSR OUTLET -->', html)
|
|
|
|
const finalHtml = transformedTemplate.replace('<!-- INJECT META TAGS -->', metaTagsHtml).replace('<!-- SSR OUTLET -->', html)
|
|
|
|
|
|
|
|
|
|
|
|