Skip to content

Add instance to bluesky similar to mastodon #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/LinksKit/Model/SocialPlatform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation
///
/// Use this enum to specify social media platforms when configuring social links in LinksKit.
public enum SocialPlatform: Hashable {
case bluesky
case bluesky(instance: String)
case facebook
case github
case instagram
Expand Down Expand Up @@ -36,7 +36,7 @@ public enum SocialPlatform: Hashable {

func url(handle: String) -> URL {
switch self {
case .bluesky: URL(string: "https://bsky.app/profile/\(handle)")!
case .bluesky(let instance): URL(string: "https://bsky.app/profile/\(handle).\(instance)")!
case .facebook: URL(string: "https://facebook.com/\(handle)")!
case .github: URL(string: "https://github.com/\(handle)")!
case .instagram: URL(string: "https://instagram.com/\(handle)")!
Expand Down