File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Provider } from '@/app/provider';
44
55import { getLocale , getTranslations } from 'next-intl/server' ;
66
7- import { baseUrl , createMetadata } from '@/lib/metadata' ;
7+ import { createMetadata } from '@/lib/metadata' ;
88import type { Viewport } from 'next' ;
99import { 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
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type { Metadata } from 'next/types';
22
33export function createMetadata ( override : Metadata ) : Metadata {
44 return {
5+ metadataBase : getBaseUrl ( ) ,
56 ...override ,
67 openGraph : {
78 title : override . title ?? undefined ,
@@ -21,10 +22,8 @@ export function createMetadata(override: Metadata): Metadata {
2122 } ;
2223}
2324
24- export const baseUrl =
25- process . env . NODE_ENV === 'development' ||
26- ! process . env . NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
25+ export function getBaseUrl ( ) : URL {
26+ return ! process . env . VERCEL_PROJECT_PRODUCTION_URL
2727 ? new URL ( 'http://localhost:3000' )
28- : new URL (
29- `https://${ process . env . NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL } ` ,
30- ) ;
28+ : new URL ( `https://${ process . env . VERCEL_PROJECT_PRODUCTION_URL } ` ) ;
29+ }
You can’t perform that action at this time.
0 commit comments