fix: og image generation

This commit is contained in:
gosangam
2026-05-06 01:45:47 +05:30
parent de374eab8b
commit 7361f9c14a
28 changed files with 221 additions and 45 deletions
+9 -3
View File
@@ -46,7 +46,15 @@ export async function generateMetadata({
const { mantra: slug } = await params;
const sp = await searchParams;
const quote = extractQuoteFromHl(sp);
const content = await getIsoContent(slug);
const isVerse_ = content && "mantra" in content && "devanagari" in content;
const paragraphs = content
? isVerse_
? [(content as IsoVerse).translation, ...(content as IsoVerse).purport]
: (content as IsoIntroSegment).paragraphs
: undefined;
const quote = extractQuoteFromHl(sp, paragraphs);
if (quote) {
return buildOgMeta({
title: "Śrī Īśopaniṣad",
@@ -55,8 +63,6 @@ export async function generateMetadata({
});
}
const content = await getIsoContent(slug);
const isVerse_ = content && "mantra" in content && "devanagari" in content;
const title = isVerse_
? `${(content as IsoVerse).reference}: ${(content as IsoVerse).title}`
: content && "title" in content