(core) Add Open Graph image tags

Summary: Adds a few missing Open Graph tags to Grist pages.

Test Plan: Manual.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3586
This commit is contained in:
George Gevoian 2022-08-16 10:37:55 -07:00
parent 0c5441b176
commit 360d838578

View File

@ -164,12 +164,16 @@ function getPageMetadataHtmlSnippet(config: GristLoadConfig): string {
if (description) {
const content = handlebars.Utils.escapeExpression(description);
metadataElements.push(`<meta name="description" content="${content}">`);
metadataElements.push(`<meta property="og:description" content="${content}">`);
metadataElements.push(`<meta name="twitter:description" content="${content}">`);
}
const thumbnail = maybeDoc?.options?.icon;
if (thumbnail) {
const content = handlebars.Utils.escapeExpression(thumbnail);
const icon = maybeDoc?.options?.icon;
if (icon) {
const content = handlebars.Utils.escapeExpression(icon);
metadataElements.push(`<meta name="thumbnail" content="${content}">`);
metadataElements.push(`<meta property="og:image" content="${content}">`);
metadataElements.push(`<meta name="twitter:image" content="${content}">`);
}
return metadataElements.join('\n');