Skip to content

Commit fe665ba

Browse files
Merge pull request #3538 from SwiftPackageIndex/custom-collections-blogpost
Custom collections blogpost
2 parents 0c2d04f + 6a7d394 commit fe665ba

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

Resources/Blog/Posts/introducing-custom-package-collections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The `description` field brielfly explains the motivation for this custom collect
4040

4141
The optional `badge` field is used to style the small badge next to the collection name on the package page. If omitted, the collection will have no badge.
4242

43-
Finally, the `url` field points to a location where you maintain a list of package URLs that belong to the collection. There should be of the format `https://github.com/author/package.git`. In particular, make sure the URL scheme is `https` and the `.git` suffix is included.
43+
Finally, the `url` field points to a location where you maintain a list of package URLs that belong to the collection. These should be of the format `https://github.com/author/package.git`. In particular, make sure the URL scheme is `https` and the `.git` suffix is included.
4444

4545
We match the listed packages against the list of all packages in the Swift Package Index and include only the ones we are able to match. Note that the matching is case-insensitive.
4646

Resources/Blog/posts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,5 +196,5 @@
196196
- slug: introducing-custom-package-collections
197197
title: Introducing custom package collections
198198
summary: We've added support for custom package collections to allow well-known community efforts to present package collections.
199-
published_at: 2024-11-22
200-
published: false
199+
published_at: 2024-12-09
200+
published: true

Sources/App/Controllers/API/API+PackageController+GetRoute.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ extension API.PackageController.GetRoute {
102102
}
103103

104104
static func customCollections(on database: Database, package: Package) async -> [CustomCollection.Details] {
105-
@Dependency(\.environment) var environment
106-
guard environment.current() == .development else { return [] }
107105
do {
108106
try await package.$customCollections.load(on: database)
109107
return package.customCollections.map(\.details)

Sources/App/Views/PackageController/GetRoute.Model+ext.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,6 @@ extension API.PackageController.GetRoute.Model {
399399
}
400400

401401
func customCollectionsListItem() -> Node<HTML.ListContext> {
402-
@Dependency(\.environment) var environment
403-
guard environment.current() == .development
404-
else { return .empty }
405-
406402
guard customCollections.isEmpty == false
407403
else { return .empty }
408404

Tests/AppTests/__Snapshots__/WebpageSnapshotTests/test_PackageShowView_customCollection.1.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ <h4>When working with a Swift Package Manager manifest:</h4>
162162
<a href="https://github.com/Alamofire/Alamofire/pulls">5 open pull requests</a>. The last issue was closed 5 days ago and the last pull request was merged/closed 6 days ago.
163163
</li>
164164
<li class="dependencies">This package depends on 2 other packages.</li>
165+
<li class="custom-collections">Member of the
166+
<a href="/collections/custom-collection">Custom Collection</a> collection.
167+
</li>
165168
<li class="license"> licensed</li>
166169
<li class="stars">17 stars</li>
167170
<li class="libraries">3 libraries</li>

0 commit comments

Comments
 (0)