this repo has no description
1
fork

Configure Feed

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

fix correct link

Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com>

+20 -1
+20 -1
internal/converter/markdown.go
··· 81 81 continue 82 82 } 83 83 // Render as a blockquote link to the Bluesky post 84 - postURL := fmt.Sprintf("https://bsky.app/profile/%s/post/%s", "did:...", lastPathPart(postBlock.PostRef.Uri)) 84 + // Parse AT-URI: at://did:plc:abc123/app.bsky.feed.post/postID 85 + did, postID := parseATUri(postBlock.PostRef.Uri) 86 + postURL := fmt.Sprintf("https://bsky.app/profile/%s/post/%s", did, postID) 85 87 sb.WriteString(fmt.Sprintf("> [View on Bluesky](%s)\n\n", postURL)) 86 88 } 87 89 } ··· 154 156 parts := strings.Split(uri, "/") 155 157 return parts[len(parts)-1] 156 158 } 159 + 160 + // parseATUri extracts DID and record key from an AT-URI 161 + // Example: at://did:plc:abc123/app.bsky.feed.post/3mbrxzvw36c22 162 + // Returns: (did:plc:abc123, 3mbrxzvw36c22) 163 + func parseATUri(uri string) (did string, recordKey string) { 164 + // Remove "at://" prefix 165 + uri = strings.TrimPrefix(uri, "at://") 166 + 167 + // Split into parts 168 + parts := strings.Split(uri, "/") 169 + if len(parts) >= 3 { 170 + did = parts[0] // did:plc:abc123 171 + recordKey = parts[len(parts)-1] // 3mbrxzvw36c22 172 + } 173 + 174 + return did, recordKey 175 + }