Skip to content

Commit efee617

Browse files
fix metadata baseurl
1 parent 4462b88 commit efee617

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

frontends/main/src/app/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ import type { Metadata } from "next"
33
import HomePage from "@/app-pages/HomePage/HomePage"
44
import { getMetadataAsync } from "@/common/metadata"
55

6+
const { NEXT_PUBLIC_ORIGIN } = process.env
7+
68
export async function generateMetadata({
79
searchParams,
810
}: {
911
searchParams: { [key: string]: string | string[] | undefined }
1012
}): Promise<Metadata> {
1113
return await getMetadataAsync({
14+
metadataBase: NEXT_PUBLIC_ORIGIN ? new URL(NEXT_PUBLIC_ORIGIN) : null,
1215
title: "Learn with MIT",
1316
searchParams,
1417
})

frontends/main/src/common/metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { RESOURCE_DRAWER_QUERY_PARAM } from "@/common/urls"
22
import { learningResourcesApi } from "api/clients"
33
import type { Metadata } from "next"
44

5-
const DEFAULT_OG_IMAGE = `${process.env.NEXT_PUBLIC_ORIGIN}/images/learn-og-image.jpg`
5+
const DEFAULT_OG_IMAGE = "/images/learn-og-image.jpg"
66

77
type MetadataAsyncProps = {
88
title?: string

0 commit comments

Comments
 (0)