From 760ce67207f97c48802cda8c5e3d593862044e76 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Wed, 26 Nov 2025 17:29:39 -0500 Subject: [PATCH] fix backlink req url for looseleafs --- app/lish/[did]/[publication]/[rkey]/getPostPageData.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts b/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts index 7f26cd9f..395b5348 100644 --- a/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts +++ b/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts @@ -23,8 +23,10 @@ export async function getPostPageData(uri: string) { // Fetch constellation backlinks for mentions const pubRecord = document.documents_in_publications[0]?.publications ?.record as PubLeafletPublication.Record; - const rkey = new AtUri(uri).rkey; - const postUrl = `https://${pubRecord?.base_path}/${rkey}`; + let aturi = new AtUri(uri); + const postUrl = pubRecord + ? `https://${pubRecord?.base_path}/${aturi.rkey}` + : `https://leaflet.pub/p/${aturi.host}/${aturi.rkey}`; const constellationBacklinks = await getConstellationBacklinks(postUrl); // Deduplicate constellation backlinks (same post could appear in both links and embeds) -- 2.51.2