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
+13 -1
View File
@@ -46,7 +46,19 @@ export async function generateMetadata({
const { text: slug } = await params;
const sp = await searchParams;
const quote = extractQuoteFromHl(sp);
const content = await getNoiContent(slug);
let paragraphs: string[] | undefined;
if (content) {
if ("devanagari" in content) {
// It's a verse
paragraphs = [content.translation, ...content.purport];
} else if ("paragraphs" in content) {
// It's an intro segment
paragraphs = content.paragraphs;
}
}
const quote = extractQuoteFromHl(sp, paragraphs);
if (quote) {
return buildOgMeta({
title: "The Nectar of Instruction",