tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
298
fork
atom
a tool for shared writing and social publishing
298
fork
atom
overview
issues
31
pulls
3
pipelines
fix backlink req url for looseleafs
awarm.space
4 months ago
760ce672
ff2a4214
+4
-2
1 changed file
expand all
collapse all
unified
split
app
lish
[did]
[publication]
[rkey]
getPostPageData.ts
+4
-2
app/lish/[did]/[publication]/[rkey]/getPostPageData.ts
reviewed
···
23
23
// Fetch constellation backlinks for mentions
24
24
const pubRecord = document.documents_in_publications[0]?.publications
25
25
?.record as PubLeafletPublication.Record;
26
26
-
const rkey = new AtUri(uri).rkey;
27
27
-
const postUrl = `https://${pubRecord?.base_path}/${rkey}`;
26
26
+
let aturi = new AtUri(uri);
27
27
+
const postUrl = pubRecord
28
28
+
? `https://${pubRecord?.base_path}/${aturi.rkey}`
29
29
+
: `https://leaflet.pub/p/${aturi.host}/${aturi.rkey}`;
28
30
const constellationBacklinks = await getConstellationBacklinks(postUrl);
29
31
30
32
// Deduplicate constellation backlinks (same post could appear in both links and embeds)