11import { Constellation } from '#shared/utils/constellation'
2- // import { NPMX_SITE } from '#shared/utils/constants'
3-
4- const BLOG_BACKLINK_TTL_IN_SECONDS = 60 * 5
2+ import { NPMX_SITE } from '#shared/utils/constants'
53
64export interface BlogPostBlueskyLink {
75 did : string
@@ -15,9 +13,7 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
1513 const blogUrl = computed ( ( ) => {
1614 const s = toValue ( slug )
1715 if ( ! s ) return null
18- // return `${NPMX_SITE}/blog/${s}`
19- // TODO: Deploy Preview used for testing remove before merge
20- return `https://npmxdev-git-fork-jonathanyeong-feat-atproto-blog-fe-poetry.vercel.app/blog/${ s } `
16+ return `${ NPMX_SITE } /blog/${ s } `
2117 } )
2218
2319 return useLazyAsyncData < BlogPostBlueskyLink | null > (
@@ -34,14 +30,10 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
3430 url ,
3531 'app.bsky.feed.post' ,
3632 'embed.external.uri' ,
37- 1 ,
38- undefined ,
39- false ,
40- [ [ 'did:plc:5ixnpdbogli5f7fbbee5fmuq' ] ] ,
41- BLOG_BACKLINK_TTL_IN_SECONDS ,
33+ [ [ 'did:plc:jbeaa5kdaladzwq3r7f5xgwe' ] ] ,
4234 )
4335
44- const embedRecord = embedBacklinks . records [ 0 ]
36+ const embedRecord = embedBacklinks . records [ embedBacklinks . records . length - 1 ]
4537 if ( embedRecord ) {
4638 return {
4739 did : embedRecord . did ,
@@ -54,15 +46,11 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
5446 const { data : facetBacklinks } = await constellation . getBackLinks (
5547 url ,
5648 'app.bsky.feed.post' ,
57- 'facets.features.uri' ,
58- 1 ,
59- undefined ,
60- false ,
61- [ ] ,
62- BLOG_BACKLINK_TTL_IN_SECONDS ,
49+ 'facets[].features[app.bsky.richtext.facet#link].uri' ,
50+ [ [ 'did:plc:jbeaa5kdaladzwq3r7f5xgwe' ] ] ,
6351 )
6452
65- const facetRecord = facetBacklinks . records [ 0 ]
53+ const facetRecord = facetBacklinks . records [ facetBacklinks . records . length - 1 ]
6654 if ( facetRecord ) {
6755 return {
6856 did : facetRecord . did ,
0 commit comments