Skip to content

Commit 75b6ea4

Browse files
Merge pull request #2 from upayanmazumder-DevLabs/opengraph-tags
Update image URLs in metadata for consistency and absolute paths
2 parents 88a31ee + 30918f9 commit 75b6ea4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

app/src/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const metadata: Metadata = {
2323
siteName: 'Kargo',
2424
images: [
2525
{
26-
url: '/og-image.png',
26+
url: 'https://kargo.dscvit.com/og-image.png',
2727
width: 1200,
2828
height: 630,
2929
alt: 'Kargo Open Graph Image',
@@ -37,7 +37,7 @@ export const metadata: Metadata = {
3737
title: 'Kargo',
3838
description:
3939
'Kargo lets you deploy containerized applications with full flexibility — AI-powered setup, secure infrastructure, and Kubernetes-native scaling, all from a powerful web interface.',
40-
images: ['/og-image.png'],
40+
images: ['https://kargo.dscvit.com/og-image.png'],
4141
},
4242
manifest: '/manifest.webmanifest',
4343
robots: {

app/src/lib/metadata.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ export function generatePageMetadata({
1515
image = '/og-image.png',
1616
imageAlt,
1717
}: PageMetadataOptions): Metadata {
18-
const url = `https://kargo.dscvit.com${path}`;
18+
const baseUrl = 'https://kargo.dscvit.com';
19+
const url = `${baseUrl}${path}`;
1920
const fullTitle = path === '' ? title : `${title} - Kargo`;
2021
const altText = imageAlt || `${title} - Kargo`;
22+
const absoluteImageUrl = new URL(image, baseUrl).href;
2123

2224
return {
2325
title: fullTitle,
@@ -29,7 +31,7 @@ export function generatePageMetadata({
2931
siteName: 'Kargo',
3032
images: [
3133
{
32-
url: image,
34+
url: absoluteImageUrl,
3335
width: 1200,
3436
height: 630,
3537
alt: altText,
@@ -42,7 +44,7 @@ export function generatePageMetadata({
4244
card: 'summary_large_image',
4345
title: fullTitle,
4446
description,
45-
images: [image],
47+
images: [absoluteImageUrl],
4648
},
4749
};
4850
}

0 commit comments

Comments
 (0)