diff --git a/src/pages/file/[id].tsx b/src/pages/file/[id].tsx index 0b0cb57..553309d 100644 --- a/src/pages/file/[id].tsx +++ b/src/pages/file/[id].tsx @@ -124,6 +124,7 @@ export default function File({ id, fileName }: Props) { title={`Viewing ${fileName.split(".").slice(0, -1).join(".")}`} openGraph={{ title: fileName.split(".").slice(0, -1).join("."), + description: `Viewing ${fileName.split(".").slice(0, -1).join(".")}`, url: `${process.env.NEXT_PUBLIC_DOMAIN}/file/${encodeURIComponent( id, )}`, diff --git a/src/pages/folder/[id].tsx b/src/pages/folder/[id].tsx index 1ba71bd..6580007 100644 --- a/src/pages/folder/[id].tsx +++ b/src/pages/folder/[id].tsx @@ -110,11 +110,14 @@ export default function Home({ id, folderName, bannerFileId }: Props) { openGraph={{ title: folderName, url: `${process.env.NEXT_PUBLIC_DOMAIN}/folder/${id}`, + description: `Exploring ${folderName}}`, images: [ { - url: `${ - process.env.NEXT_PUBLIC_DOMAIN - }/api/og?fileId=${encodeURIComponent(bannerFileId as string)}`, + url: bannerFileId + ? `${ + process.env.NEXT_PUBLIC_DOMAIN + }/api/og?fileId=${encodeURIComponent(bannerFileId as string)}` + : `${process.env.NEXT_PUBLIC_DOMAIN}/api/og`, alt: siteConfig.siteName, width: 1200, height: 630, diff --git a/src/pages/index.tsx b/src/pages/index.tsx index f26b9d5..0130411 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -105,9 +105,11 @@ export default function Home({ bannerFileId }: Props) { openGraph={{ images: [ { - url: `${ - process.env.NEXT_PUBLIC_DOMAIN - }/api/og?fileId=${encodeURIComponent(bannerFileId as string)}`, + url: bannerFileId + ? `${ + process.env.NEXT_PUBLIC_DOMAIN + }/api/og?fileId=${encodeURIComponent(bannerFileId as string)}` + : `${process.env.NEXT_PUBLIC_DOMAIN}/api/og`, alt: siteConfig.siteName, width: 1200, height: 630,