Skip to content

Commit

Permalink
fix metadata baseurl
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherChudzicki committed Oct 9, 2024
1 parent 4462b88 commit efee617
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontends/main/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import type { Metadata } from "next"
import HomePage from "@/app-pages/HomePage/HomePage"
import { getMetadataAsync } from "@/common/metadata"

const { NEXT_PUBLIC_ORIGIN } = process.env

export async function generateMetadata({
searchParams,
}: {
searchParams: { [key: string]: string | string[] | undefined }
}): Promise<Metadata> {
return await getMetadataAsync({
metadataBase: NEXT_PUBLIC_ORIGIN ? new URL(NEXT_PUBLIC_ORIGIN) : null,
title: "Learn with MIT",
searchParams,
})
Expand Down
2 changes: 1 addition & 1 deletion frontends/main/src/common/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { RESOURCE_DRAWER_QUERY_PARAM } from "@/common/urls"
import { learningResourcesApi } from "api/clients"
import type { Metadata } from "next"

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

type MetadataAsyncProps = {
title?: string
Expand Down

0 comments on commit efee617

Please sign in to comment.