fix base url without URL

This commit is contained in:
Kalidou Diagne
2024-05-07 17:43:04 +09:00
parent 14e4a1b157
commit 747429b9cb

View File

@@ -37,10 +37,7 @@ export async function generateMetadata(
const BASE_URL =
process.env.NODE_ENV === "production" ? "https://pse.dev" : "."
const customImage = `${BASE_URL}/${currProject.image}`.replace(
"//pse.dev//",
"//pse.dev/"
) // prevent double slashes
const customImage = `${BASE_URL}/${currProject.image}`
const imageUrl =
currProject?.image?.length > 0 ? customImage : `${BASE_URL}/og-image.png`