Skip to content

Commit 704c3cc

Browse files
committed
Quick edit of the blog post and updated screenshots.
1 parent d702515 commit 704c3cc

9 files changed

+16
-16
lines changed
-17.1 KB
Binary file not shown.
-17.3 KB
Binary file not shown.
-187 KB
Binary file not shown.
-171 KB
Binary file not shown.
17.8 KB
Loading
15.5 KB
Loading
172 KB
Loading
159 KB
Loading

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
We first launched support for package collections ahead of WWDC 2021 and they are a convenient way to add packages to an Xcode project.
1+
We first launched support for package collections ahead of WWDC 2021 as a convenient way to add packages to an Xcode project.
22

3-
We generate a package collection for all packages by an author or organisation. For example, you can copy a link for the package collection for all of Apple’s packages via [Apple’s author page](https://swiftpackageindex.com/apple) and add it to Xcode's package collections.
3+
The first release of this feature generated a package collection for all an author or organisation’s packages. For example, you can copy a link for the package collection for Apple’s packages via [their author page](https://swiftpackageindex.com/apple) and [add it to Xcode](https://swiftpackageindex.com/package-collections).
44

5-
Since launching the feature we have been asked if we could support more curated collections that span multiple authors or organisations and today we are adding the ability to create package collections for key community efforts.
5+
Human-curated collections are a logical next step, and we received a request to implement this from the SSWG. Today, we are adding the ability to create package collections for key community efforts.
66

77
### How does it work?
88

9-
The way this works is quite similar to adding packages to the Swift Package Index. Instead of adding a package to [packages.json](), you add a whole package list (whose contents _you_ maintain) to [custom-package-collections.json]().
9+
Custom collections work in a similar way to our package list. However, instead of adding a package to [packages.json](https://github.com/SwiftPackageIndex/PackageList/blob/main/packages.json), you add the location of a collection index file (whose contents _you_ maintain) to [custom-package-collections.json](https://github.com/SwiftPackageIndex/PackageList/blob/main/custom-package-collections.json).
1010

11-
Here’s what this looks like, taking the Swift Server Workgroup Graduated packages as an example:
11+
[Here’s what this looks like](https://github.com/SwiftPackageIndex/PackageList/blob/6bc193c42d7b523a9159632b8fbe89e0c172316f/custom-package-collections.json#L2-L8), taking the Swift Server Workgroup Graduated packages as an example:
1212

1313
```
1414
{
@@ -20,31 +20,31 @@ Here’s what this looks like, taking the Swift Server Workgroup Graduated packa
2020
}
2121
```
2222

23-
The `key` field essentially determines the URL at which the package collection is available on the Swift Package Index:
23+
The fields in that JSON determine how we find and display the custom package collection.
2424

25-
[https://swiftpackageindex.com/collections/sswg-graduated](https://swiftpackageindex.com/collections/sswg-graduated)
25+
The `key` field specifies the URL where the package collection will available on the Swift Package Index website:
26+
27+
<picture>
28+
<source srcset="/images/blog/custom-package-collection-url~dark.png" media="(prefers-color-scheme: dark)">
29+
<img src="/images/blog/custom-package-collection-url~light.png" alt="Safari's Address Bar with the package collection URL in it highlighting the part of the URL related to the key field.">
30+
</picture>
2631

2732
The `name` is its display name on the collections page as well as on the package page where we show a package’s membership to package collections:
2833

2934
<picture>
30-
<source srcset="/images/blog/custom-collections-package-page-dark.png" media="(prefers-color-scheme: dark)">
31-
<img src="/images/blog/custom-collections-package-page-light.png" alt="Screenshot of the custom collection badge on a package page.">
35+
<source srcset="/images/blog/custom-package-collections-package-page~dark.png" media="(prefers-color-scheme: dark)">
36+
<img src="/images/blog/custom-package-collections-package-page~light.png" alt="The custom package collection badge highlighted on a package page.">
3237
</picture>
3338

3439
The `description` field brielfly explains the motivation for this custom collection. It serves informational purposes and is not displayed.
3540

36-
The optional field `badge` can be used to style the representation of the collection on the package page. If present, it will be set apart with a different background as shown in the screenshot below.
37-
38-
<picture>
39-
<source srcset="/images/blog/custom-collection-badge-dark.png" media="(prefers-color-scheme: dark)">
40-
<img src="/images/blog/custom-collection-badge-light.png" alt="Screenshot of the custom collection display with and without badge.">
41-
</picture>
41+
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

4343
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.
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

47-
For example, here is what the SSWG Graduated package collection’s content looks like:
47+
For example, here is the SSWG Graduated package collection’s list of packages:
4848

4949
```
5050
[

0 commit comments

Comments
 (0)