Skip to content

Commit 298a14d

Browse files
authored
Merge pull request #3622 from SwiftPackageIndex/sponsor-switchover
Sponsor switchover
2 parents b2d72cc + cac2d08 commit 298a14d

File tree

6 files changed

+46
-13
lines changed

6 files changed

+46
-13
lines changed

FrontEnd/styles/home.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,22 @@ body.home {
7171
}
7272
}
7373
}
74+
75+
.ccta-availability {
76+
padding: 15px;
77+
font-size: 13px;
78+
background-color: var(--panel-button-background);
79+
80+
p {
81+
margin: 5px 0;
82+
}
83+
84+
.support {
85+
margin: 0 0 5px;
86+
font-weight: bold;
87+
}
88+
89+
.cta {
90+
text-align: right;
91+
}
92+
}
-3.07 KB
Binary file not shown.
-2.94 KB
Binary file not shown.

Sources/App/Core/ExternalURL.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,30 @@
1515
import Plot
1616

1717
enum ExternalURL: URLRepresentable {
18+
case addNewPackage(_ owner: String, _ repository: String)
19+
case contactMailto
1820
case mastodon
21+
case podcast
1922
case projectGitHub
2023
case projectSponsorship
2124
case raiseNewIssue
22-
case podcast
23-
case addNewPackage(_ owner: String, _ repository: String)
24-
2525

2626
var description: String {
2727
switch(self) {
28+
case let .addNewPackage(owner, repository):
29+
return "https://github.com/SwiftPackageIndex/PackageList/issues/new?labels=Add+Package&template=add_package.yml&title=Add+\(repository)&list=https%3A%2F%2Fgithub.com%2F\(owner)%2F\(repository).git"
30+
case .contactMailto:
31+
return "mailto:[email protected]"
2832
case .mastodon:
2933
return "https://mas.to/@SwiftPackageIndex"
34+
case .podcast:
35+
return "https://swiftpackageindexing.transistor.fm"
3036
case .projectGitHub:
3137
return "https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server"
3238
case .projectSponsorship:
3339
return "https://github.com/sponsors/SwiftPackageIndex"
3440
case .raiseNewIssue:
3541
return "https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/new/choose"
36-
case .podcast:
37-
return "https://swiftpackageindexing.transistor.fm"
38-
case let .addNewPackage(owner, repository):
39-
return "https://github.com/SwiftPackageIndex/PackageList/issues/new?labels=Add+Package&template=add_package.yml&title=Add+\(repository)&list=https%3A%2F%2Fgithub.com%2F\(owner)%2F\(repository).git"
4042
}
4143
}
4244
}

Sources/App/Core/Supporters.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ enum Supporters {
2525
darkModeUrl: "/images/sponsors/emerge~dark.png"),
2626
url: "https://www.emergetools.com/?utm_source=spi2&utm_medium=sponsor&utm_campaign=emerge",
2727
advertisingCopy: "Join the future of mobile development. Trusted by top companies like Duolingo, Square, DoorDash & more…"),
28-
.init(name: "ContextSDK",
29-
logo: .init(lightModeUrl: "/images/sponsors/contextsdk.png",
30-
darkModeUrl: "/images/sponsors/contextsdk~dark.png"),
31-
url: "https://contextsdk.com",
32-
advertisingCopy: "Intent detection with real-world context. Lean, lightweight and GDPR compliant out of the box."),
3328
]
3429

3530
nonisolated(unsafe) static var infrastructure: [Corporate] = [

Sources/App/Views/Home/HomeIndex+View.swift

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,24 @@ enum HomeIndex {
109109
analyticsEvent: "Home - Supporters CTA"),
110110
.group(
111111
Supporters.corporate.shuffled().map(\.advertisementNode)
112-
)
112+
),
113+
.if(Supporters.corporate.count < 2, .div(
114+
.class("ccta-availability"),
115+
.p(
116+
.class("support"),
117+
.text("Support the Swift Package Index")
118+
),
119+
.p(
120+
.text("We have one homepage sponsorship spot available. Support the project while promoting your company.")
121+
),
122+
.p(
123+
.class("cta"),
124+
.a(
125+
.href(ExternalURL.contactMailto),
126+
.text("Get in touch for details →")
127+
)
128+
)
129+
))
113130
)
114131
}
115132

0 commit comments

Comments
 (0)