fix: letter source

This commit is contained in:
gosangam
2026-05-05 10:11:30 +05:30
parent ec5093e5cb
commit 237840148f
+9 -2
View File
@@ -202,10 +202,17 @@ function getSourceReference(): {
parts[1] !== "recipient" &&
parts[1] !== "location"
) {
// Try to get the title from the h1
// h1 contains "Letter to Mukunda" — use it as the title
const h1 = document.querySelector("h1");
const title = h1?.textContent?.trim() || "Letter";
return { title: "Letters of Śrīla Prabhupāda", detail: title, url };
// The <p> sibling after h1 contains "15 January, 1968 · Calcutta"
const metaP = document.querySelector(
"header p.text-muted-foreground, header p[class*='muted']",
);
const meta = metaP?.textContent?.trim() || null;
return { title, detail: meta, url };
}
// /essays/[slug]