(READ ONLY) Margin is an open annotation layer for the internet. Powered by the AT Protocol. margin.at
extension web atproto comments
98
fork

Configure Feed

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

more routing and url stuff

+15 -2
+15 -2
web/src/components/modals/ShareMenu.tsx
··· 57 57 const uriParts = uri.split("/"); 58 58 const rkey = uriParts[uriParts.length - 1]; 59 59 const did = uriParts[2]; 60 + const collection = uriParts[3] ?? ""; 60 61 61 62 if (uri.includes("network.cosmik.card")) 62 63 return `${origin}/at/${did}/${rkey}`; 63 - if (handle && type) 64 - return `${origin}/${handle}/${type.toLowerCase()}/${rkey}`; 64 + 65 + if (handle) { 66 + const segment = collection.includes("at.margin.note") 67 + ? "note" 68 + : collection.includes("at.margin.highlight") 69 + ? "highlight" 70 + : collection.includes("at.margin.bookmark") 71 + ? "bookmark" 72 + : collection.includes("at.margin.annotation") 73 + ? "annotation" 74 + : (type?.toLowerCase() ?? "note"); 75 + return `${origin}/${handle}/${segment}/${rkey}`; 76 + } 77 + 65 78 return `${origin}/at/${did}/${rkey}`; 66 79 }; 67 80