Commit 07371a1 1 parent f0e95f4 commit 07371a1 Copy full SHA for 07371a1
File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export const routes = {
17
17
params : { name : "Parameters" , pathname : "/_params" } ,
18
18
} as const satisfies Record < string , Route > ;
19
19
20
+ // ref: https://nextjs.org/docs/app/api-reference/functions/generate-metadata#default-value
20
21
const getSiteUrl = ( ) => {
21
22
if (
22
23
process . env . NEXT_PUBLIC_VERCEL_ENV === "production" &&
@@ -26,10 +27,14 @@ const getSiteUrl = () => {
26
27
}
27
28
28
29
if (
29
- process . env . NEXT_PUBLIC_VERCEL_ENV &&
30
- process . env . NEXT_PUBLIC_VERCEL_URL
30
+ process . env . NEXT_PUBLIC_VERCEL_ENV === "preview" &&
31
+ ( process . env . NEXT_PUBLIC_VERCEL_BRANCH_URL ||
32
+ process . env . NEXT_PUBLIC_VERCEL_URL )
31
33
) {
32
- return `https://${ process . env . NEXT_PUBLIC_VERCEL_URL } ` ;
34
+ return `https://${
35
+ process . env . NEXT_PUBLIC_VERCEL_BRANCH_URL ??
36
+ process . env . NEXT_PUBLIC_VERCEL_URL
37
+ } `;
33
38
}
34
39
35
40
return `http://localhost:${ process . env . PORT ?? 3000 } ` ;
You can’t perform that action at this time.
0 commit comments