fix OG images again
This commit is contained in:
parent
f081435b17
commit
261fa687ea
|
@ -111,6 +111,8 @@ export async function generateMetadata({ params }: { params: { id: string } }) {
|
||||||
|
|
||||||
const post = schema.parse(await client.fetch(query))[0];
|
const post = schema.parse(await client.fetch(query))[0];
|
||||||
|
|
||||||
|
const r = post.mainImage?.match(/(?<width>\d+)x(?<height>\d+)/);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: post.title,
|
title: post.title,
|
||||||
description: post.subtitle,
|
description: post.subtitle,
|
||||||
|
@ -124,6 +126,8 @@ export async function generateMetadata({ params }: { params: { id: string } }) {
|
||||||
images: [
|
images: [
|
||||||
{
|
{
|
||||||
url: post.mainImage,
|
url: post.mainImage,
|
||||||
|
width: parseInt(r?.groups?.width ?? "400"),
|
||||||
|
height: parseInt(r?.groups?.height ?? "400"),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -115,6 +115,8 @@ export async function generateMetadata({ params }: { params: { id: string } }) {
|
||||||
|
|
||||||
const project = projectSchema.parse(await client.fetch(projectQuery))[0];
|
const project = projectSchema.parse(await client.fetch(projectQuery))[0];
|
||||||
|
|
||||||
|
const r = project.mainImage?.match(/(?<width>\d+)x(?<height>\d+)/);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: project.title,
|
title: project.title,
|
||||||
description: project.subtitle,
|
description: project.subtitle,
|
||||||
|
@ -128,6 +130,8 @@ export async function generateMetadata({ params }: { params: { id: string } }) {
|
||||||
images: [
|
images: [
|
||||||
{
|
{
|
||||||
url: project.mainImage,
|
url: project.mainImage,
|
||||||
|
width: parseInt(r?.groups?.width ?? "400"),
|
||||||
|
height: parseInt(r?.groups?.height ?? "400"),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user