File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,15 @@ function getTwitterUsername(url: string): string | undefined {
3838 return (username ?? url ).startsWith (" @" ) ? username : ` @${username } ` ;
3939}
4040
41- // Get @username from BlueSky URL
4241function getBlueskyUsername(url : string ): string | undefined {
43- const username = url .split (" /" ).pop ();
44- return (username ?? url ).startsWith (" @" ) ? username : ` @${username } ` ;
42+ const username = url .split (" /" ).pop ()?.replace (/ ^ @/ , " " );
43+ return username ? ` @${username } ` : undefined ;
44+ }
45+
46+ function getBlueskyProfileLink(username : string ): string {
47+ // Remove any leading @ if present
48+ const cleanUsername = username .replace (/ ^ @/ , " " );
49+ return ` https://bsky.app/profile/${cleanUsername } ` ;
4550}
4651
4752// Get @[email protected] from Mastodon URL@@ -208,7 +213,7 @@ function getGitHosting(url: string): string | undefined {
208213 <dt class = " font-bold" >Bluesky</dt >
209214 <dd >
210215 <a
211- href = { entry .data .bluesky_url }
216+ href = { getBlueskyProfileLink ( getBlueskyUsername ( entry .data .bluesky_url ) as string ) }
212217 class = " text-primary underline hover:text-primary-hover"
213218 >
214219 { getBlueskyUsername (entry .data .bluesky_url )}
You can’t perform that action at this time.
0 commit comments