Personal Site
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Create a function to generate the xrpc endpoint to load a blob. This will be called in the client to link to images, videos, etc

+15
+15
src/components/home/feeds/BskyPost.astro
··· 1 1 --- 2 2 import { docResolver } from "./atproto"; 3 + import { 4 + type Blob, 5 + type LegacyBlob, 6 + } from "@atcute/lexicons"; 3 7 import { AppBskyFeedPost } from "@atcute/bluesky"; 4 8 5 9 export interface Author { ··· 30 34 (service) => service.type === "AtprotoPersonalDataServer", 31 35 )[0].serviceEndpoint + "", 32 36 ); 37 + 38 + // helper functions 39 + const cidSrc = (blob: Blob | LegacyBlob, did: `did:${string}:${string}`) => 40 + new URL( 41 + "/xrpc/com.atproto.sync.getBlob/?" + 42 + new URLSearchParams({ 43 + did: did, 44 + cid: "cid" in blob ? blob.cid : blob.ref.$link, 45 + }).toString(), 46 + pds, 47 + ).toString(); 33 48 ---