aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src/server
diff options
context:
space:
mode:
authoryxshv <[email protected]>2024-04-13 12:38:48 +0530
committeryxshv <[email protected]>2024-04-13 12:38:48 +0530
commit1868eaa9a35ce934e104de478b3e7905194ae373 (patch)
tree82bb7f431d70c1638e4c01a14d07f6605d8ec235 /apps/web/src/server
parentfix dialog to add spaces (diff)
parentaaaaaaaaaaaaa (diff)
downloadsupermemory-1868eaa9a35ce934e104de478b3e7905194ae373.tar.xz
supermemory-1868eaa9a35ce934e104de478b3e7905194ae373.zip
merge
Diffstat (limited to 'apps/web/src/server')
-rw-r--r--apps/web/src/server/helpers.ts12
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;