Skip to content

Commit 54ffde0

Browse files
committed
feat: update metadata baseUrl
1 parent 6fe0dfc commit 54ffde0

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

apps/docs/src/app/layout.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Provider } from '@/app/provider';
44

55
import { getLocale, getTranslations } from 'next-intl/server';
66

7-
import { baseUrl, createMetadata } from '@/lib/metadata';
7+
import { createMetadata } from '@/lib/metadata';
88
import type { Viewport } from 'next';
99
import { Geist, Geist_Mono } from 'next/font/google';
1010

@@ -17,7 +17,6 @@ export async function generateMetadata() {
1717
default: t('title'),
1818
},
1919
description: t('description'),
20-
metadataBase: baseUrl,
2120
});
2221
}
2322

apps/docs/src/lib/metadata.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ export function createMetadata(override: Metadata): Metadata {
2121
};
2222
}
2323

24-
export const baseUrl =
25-
process.env.NODE_ENV === 'development' ||
26-
!process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
27-
? new URL('http://localhost:3000')
28-
: new URL(
29-
`https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`,
30-
);
24+
export const BASE_URL =
25+
process.env.NEXT_PUBLIC_VERCEL_ENV == null ||
26+
process.env.NEXT_PUBLIC_VERCEL_ENV === 'development'
27+
? 'http://localhost:3000'
28+
: process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview'
29+
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
30+
: `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`;

0 commit comments

Comments
 (0)