From 5a458afc43d3fb7c33a99ae92a02e0b5677a7132 Mon Sep 17 00:00:00 2001 From: Steven Tey Date: Mon, 13 Jan 2025 08:21:04 -0800 Subject: [PATCH] fix cloaking issue --- apps/web/app/cloaked/[url]/page.tsx | 2 +- packages/utils/src/functions/construct-metadata.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/web/app/cloaked/[url]/page.tsx b/apps/web/app/cloaked/[url]/page.tsx index 35aac55734..f110a6ffb1 100644 --- a/apps/web/app/cloaked/[url]/page.tsx +++ b/apps/web/app/cloaked/[url]/page.tsx @@ -20,7 +20,7 @@ export async function generateMetadata({ const apexDomain = getApexDomain(url); return constructMetadata({ - title: metatags.title, + fullTitle: metatags.title, description: metatags.description, image: metatags.image, icons: `${GOOGLE_FAVICON_URL}${apexDomain}`, diff --git a/packages/utils/src/functions/construct-metadata.ts b/packages/utils/src/functions/construct-metadata.ts index ab740a7610..b8ce34bfc1 100644 --- a/packages/utils/src/functions/construct-metadata.ts +++ b/packages/utils/src/functions/construct-metadata.ts @@ -3,6 +3,7 @@ import { HOME_DOMAIN } from "../constants"; export function constructMetadata({ title, + fullTitle, description = "Dub.co is the open-source link management platform for modern marketing teams to create marketing campaigns, link sharing features, and referral programs.", image = "https://assets.dub.co/thumbnail.jpg", video, @@ -29,6 +30,7 @@ export function constructMetadata({ noIndex = false, }: { title?: string; + fullTitle?: string; description?: string; image?: string | null; video?: string | null; @@ -37,9 +39,11 @@ export function constructMetadata({ noIndex?: boolean; } = {}): Metadata { return { - title: title - ? `${title} | Dub.co` - : "Dub.co - Link Management for Modern Marketing Teams", + title: + fullTitle || + (title + ? `${title} | Dub.co` + : "Dub.co - Link Management for Modern Marketing Teams"), description, openGraph: { title,