Add other metadata: og:type and twitter:card

This commit is contained in:
fflorent 2024-10-16 17:56:43 +02:00 committed by Florent F
parent c0af6a2f23
commit 89fc76a0a9

View File

@ -289,6 +289,8 @@ function getPageMetadataHtmlSnippet(req: express.Request, config: GristLoadConfi
const metadataElements: string[] = [];
const maybeDoc = getDocFromConfig(config);
metadataElements.push('<meta property="og:type" content="website">');
metadataElements.push('<meta name="twitter:card" name="summary_large_image">');
const description = maybeDoc?.options?.description ?? translate(req, 'gristMetaDescription');
const escapedDescription = handlebars.Utils.escapeExpression(description);
metadataElements.push(`<meta name="description" content="${escapedDescription}">`);