diff options
Diffstat (limited to 'apps/web/src/server')
| -rw-r--r-- | apps/web/src/server/helpers.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/web/src/server/helpers.ts b/apps/web/src/server/helpers.ts index 519e4b17..109fa0c3 100644 --- a/apps/web/src/server/helpers.ts +++ b/apps/web/src/server/helpers.ts @@ -17,17 +17,19 @@ export async function getMetaData(url: string) { ? descriptionMatch[1] : "Description not found"; - // Extract Open Graph image - const imageMatch = html.match( - /<meta property="og:image" content="(.*?)"\s*\/?>/, + // Extract favicon + const faviconMatch = html.match( + /<link rel="(?:icon|shortcut icon)" href="(.*?)"\s*\/?>/, ); - const image = imageMatch ? imageMatch[1] : "Image not found"; + const favicon = faviconMatch + ? faviconMatch[1] + : "https://supermemory.dhr.wtf/web.svg"; // Prepare the metadata object const metadata = { title, description, - image, + image: favicon, baseUrl, }; return metadata; |