Use png as svg does not work in previews

This commit is contained in:
fflorent 2024-10-07 12:46:25 +02:00 committed by Florent F
parent b0da3350a5
commit fbe9664e18
3 changed files with 3 additions and 3 deletions

View File

@ -295,7 +295,7 @@ function getPageMetadataHtmlSnippet(req: express.Request, config: GristLoadConfi
metadataElements.push(`<meta property="og:description" content="${escapedDescription}">`);
metadataElements.push(`<meta name="twitter:description" content="${escapedDescription}">`);
const icon = maybeDoc?.options?.icon ?? new URL('icons/grist.svg', staticBaseUrl).href;
const icon = maybeDoc?.options?.icon ?? new URL('icons/grist.png', staticBaseUrl).href;
const escapedIcon = handlebars.Utils.escapeExpression(icon);
metadataElements.push(`<meta name="thumbnail" content="${escapedIcon}">`);
metadataElements.push(`<meta property="og:image" content="${escapedIcon}">`);

View File

@ -140,7 +140,7 @@ describe('HomeIntro', function() {
assert.equal(await driver.find('meta[name="twitter:description"]').getAttribute('content'), expectedDescription);
assert.equal(await driver.find('meta[property="og:description"]').getAttribute('content'), expectedDescription);
const gristIconFileName = 'grist.svg';
const gristIconFileName = 'grist.png';
assert.include(await driver.find('meta[name="thumbnail"]').getAttribute('content'), gristIconFileName);
assert.include(await driver.find('meta[name="twitter:image"]').getAttribute('content'), gristIconFileName);
assert.include(await driver.find('meta[property="og:image"]').getAttribute('content'), gristIconFileName);

View File

@ -29,7 +29,7 @@ describe('NewDocument.ntest', function() {
assert.equal(await driver.find('meta[name="twitter:description"]').getAttribute('content'), expectedDescription);
assert.equal(await driver.find('meta[property="og:description"]').getAttribute('content'), expectedDescription);
const gristIconFileName = 'grist.svg';
const gristIconFileName = 'grist.png';
assert.include(await driver.find('meta[name="thumbnail"]').getAttribute('content'), gristIconFileName);
assert.include(await driver.find('meta[name="twitter:image"]').getAttribute('content'), gristIconFileName);
assert.include(await driver.find('meta[property="og:image"]').getAttribute('content'), gristIconFileName);