Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Add support for og:video

Steven Teybd5cf6ee98f5
diff --git a/apps/web/app/proxy/[domain]/[key]/page.tsx b/apps/web/app/proxy/[domain]/[key]/page.tsx
index 5a0cfe22f5..91c99dc9a3 100644
--- a/apps/web/app/proxy/[domain]/[key]/page.tsx
+++ b/apps/web/app/proxy/[domain]/[key]/page.tsx
@@ -30,6 +30,8 @@ export async function generateMetadata({
title: unescape(data.title || ""),
description: unescape(data.description || ""),
image: data.image,
+ // TODO replace this with value from DB
+ video: "https://static.mux.com/videos/sandwich.mp4",
icons: `${GOOGLE_FAVICON_URL}${apexDomain}`,
noIndex: true,
});
diff --git a/packages/utils/src/functions/construct-metadata.ts b/packages/utils/src/functions/construct-metadata.ts
index 7e6f4ed937..74fa14b024 100644
--- a/packages/utils/src/functions/construct-metadata.ts
+++ b/packages/utils/src/functions/construct-metadata.ts
@@ -5,6 +5,7 @@ export function constructMetadata({
title = `${process.env.NEXT_PUBLIC_APP_NAME} - Link Management for Modern Marketing Teams`,
description = `${process.env.NEXT_PUBLIC_APP_NAME} 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,
icons = [
{
rel: "apple-touch-icon",
@@ -29,6 +30,7 @@ export function constructMetadata({
title?: string;
description?: string;
image?: string | null;
+ video?: string | null;
icons?: Metadata["icons"];
noIndex?: boolean;
} = {}): Metadata {
@@ -45,6 +47,13 @@ export function constructMetadata({
},
],
}),
+ ...(video && {
+ videos: [
+ {
+ url: video,
+ },
+ ],
+ }),
},
twitter: {
title,
@@ -53,6 +62,9 @@ export function constructMetadata({
card: "summary_large_image",
images: [image],
}),
+ ...(video && {
+ player: video,
+ }),
creator: "@dubdotco",
},
icons,