Skip to content

Commit

Permalink
og image fix
Browse files Browse the repository at this point in the history
  • Loading branch information
joshika39 committed May 29, 2024
1 parent a524368 commit 829de1a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ import "./globals.css";
import React from "react";
import {Inter as FontSans} from "next/font/google"
import {cn} from "@/lib/utils";
import {headers} from "next/headers";

export const runtime = 'edge';

type RootLayoutProps = {
children: React.ReactNode,
}

const url = process.env.SELF_URL || 'http://localhost:3000'

export const metadata: Metadata = {
metadataBase: new URL(url),
export async function generateMetadata(): Promise<Metadata> {
return {
metadataBase: new URL(`https://${headers().get("host")}`),
};
}

const fontSans = FontSans({
Expand All @@ -27,7 +28,7 @@ export default async function RootLayout({children}: RootLayoutProps) {
<body className={cn(
bodyClasses
)}>
{children}
{children}
</body>
</html>
);
Expand Down

0 comments on commit 829de1a

Please sign in to comment.