From d8ceb0bb7917505527eca04900c9e0bd64cba2bd Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Mon, 8 May 2023 11:04:37 +0700 Subject: [PATCH] Update next seo --- src/pages/file/[id].tsx | 1 + src/pages/folder/[id].tsx | 9 ++++++--- src/pages/index.tsx | 8 +++++--- 3 files changed, 12 insertions(+), 6 deletions(-) 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,