fix(og): fall back to thumbnail when declared cover file is missing
WeChat link cards were pointing og:image at mindspace-cover paths that never landed on disk; serve-time injection now uses thumbnail.png instead. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import crypto from 'node:crypto';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const INLINE_SCRIPT_PATTERN = /<script\b(?![^>]*\bsrc\b)[^>]*>([\s\S]*?)<\/script>/gi;
|
||||
@@ -47,6 +48,8 @@ export function decorateMindSpacePublishedHtml({
|
||||
html,
|
||||
embed = false,
|
||||
context,
|
||||
htmlFilePath = '',
|
||||
fileExists = fs.existsSync,
|
||||
userAgent = '',
|
||||
preparePublicationHtmlForEmbed,
|
||||
injectOgTags,
|
||||
@@ -69,6 +72,8 @@ export function decorateMindSpacePublishedHtml({
|
||||
pageUrl: context.pageUrl,
|
||||
pageDirUrl: context.pageDirUrl,
|
||||
fallbackImageUrl: context.fallbackImageUrl,
|
||||
htmlFilePath,
|
||||
fileExists,
|
||||
});
|
||||
const wechatShare = !embed && isWechatUserAgent(userAgent || '');
|
||||
if (wechatShare) {
|
||||
|
||||
Reference in New Issue
Block a user