Skip to content
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

Packages page #344

Merged
merged 151 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
40420c5
Sample data for one package list file.
daveverwer Mar 13, 2023
4ec3789
Renamed the packages YML file and added more structure to it.
daveverwer Mar 20, 2023
3113442
Implemented the basic page, navigation, and search box styling.
daveverwer Mar 20, 2023
0a2a7ae
Placeholder star images. These will need replacing.
daveverwer Mar 20, 2023
7cbfa6c
Better naming.
daveverwer Mar 20, 2023
b308f31
One more example section.
daveverwer Mar 20, 2023
0a8f76d
Stars should be a string rather than a number, or it loses the commas.
daveverwer Mar 20, 2023
071b15c
First draft of package list implementation.
daveverwer Mar 20, 2023
a8367a1
Remove package search.
daveverwer Mar 28, 2023
9a26331
Fix for Safari layout.
daveverwer Mar 28, 2023
16e30d1
Updated data with better examples and ChatGPT descriptions.
daveverwer Apr 3, 2023
364c22f
New potential layout for longer descriptions.
daveverwer Apr 3, 2023
9ed04ad
Added links to all packages.
daveverwer Apr 3, 2023
f7741e1
Remove package search from the Packages sidebar.
daveverwer Apr 3, 2023
7a53ef2
Tweaked opening paragraph.
daveverwer May 22, 2023
a7a7f07
Tweaks and additions to the data file.
daveverwer May 22, 2023
8e8f814
Added category links.
daveverwer May 23, 2023
2d17553
Tweaked layout.
daveverwer May 23, 2023
b755653
More YML file tweaks.
daveverwer May 23, 2023
ec2133e
More yml tweaks.
daveverwer May 23, 2023
eaf01b4
Wording tweaks.
daveverwer May 23, 2023
b7fd543
All SPI links open in a new browser tab.
daveverwer May 23, 2023
36c68d0
Reorganised categories.
daveverwer May 23, 2023
137278c
Updated the nav bar.
daveverwer May 23, 2023
cc82f9e
Remove fine grained date information.
daveverwer May 24, 2023
efddc66
Framework for three alternative versions.
daveverwer May 24, 2023
57d34e8
Jekyll task for running serve as you open the project.
daveverwer May 24, 2023
d7e8c07
Grid layout.
daveverwer May 24, 2023
f810575
De-emphasised the metadata below the description.
daveverwer May 24, 2023
e8fc10f
Hid the stars from the grid.
daveverwer May 24, 2023
68ee720
Turned platforms into an array.
daveverwer May 24, 2023
776a76c
Base the alternate design off grid.
daveverwer May 24, 2023
fe20b3a
Simplify grid layout.
daveverwer May 24, 2023
d7e1515
Tweaked platform order.
daveverwer May 24, 2023
f6e7edc
Alternate layout with platform compatibility.
daveverwer May 24, 2023
d5a797e
Added Swift version compatibility.
daveverwer May 24, 2023
4ccf67e
Final tweaks.
daveverwer May 24, 2023
a01d36e
Wording tweak in the preamble to the showcase.
daveverwer May 25, 2023
83084e5
Added a showcase reason.
daveverwer May 25, 2023
866f3e8
Tweaked the colour of the external link icon.
daveverwer May 25, 2023
4975be2
Renamed and rearranged the order of sample package pages.
daveverwer May 25, 2023
bc7c4ca
Styling tweaks on v1.
daveverwer May 25, 2023
1208e39
Moved the ellipsis into the YML file so it doesn’t show for categorie…
daveverwer May 25, 2023
0d49c9e
Added the external link icon to the v3 design.
daveverwer May 25, 2023
2f2d3eb
Removed v2 Packages design.
daveverwer May 31, 2023
0e5ce23
Moved Packages v3 design to be v2.
daveverwer May 31, 2023
6de3e30
Updated navigation.
daveverwer May 31, 2023
7d5a070
Moved platforms to be split into Apple and Linux with additional Appl…
daveverwer May 31, 2023
dec7d69
Turn the Apple compatibility into a tooltip.
daveverwer May 31, 2023
8c9268d
Use the compatibility tooltip.
daveverwer May 31, 2023
9ce17dd
Added markdown back to the showcase reason and reorganised the showca…
daveverwer May 31, 2023
34e2c34
Target blanks on showcase reasons.
daveverwer May 31, 2023
e921cc4
Split up the activity into age and activity.
daveverwer May 31, 2023
8674a20
Final v1 tweaks.
daveverwer May 31, 2023
663e853
Tweaking v2 markup.
daveverwer May 31, 2023
e9fc892
Make the lozenge CSS more specific.
daveverwer May 31, 2023
6a9a9cd
Tweaked v2 layout.
daveverwer May 31, 2023
8ec2a1b
Final v2 tweaks?
daveverwer May 31, 2023
d4535f4
Final tweaks.
daveverwer May 31, 2023
0db4b68
Slightly different treatment for the metadata headings in v2.
daveverwer Jun 1, 2023
d11f2c1
Maybe remove colons.
daveverwer Jun 1, 2023
7435e52
Removed Packages v2 design.
daveverwer Jul 18, 2023
84b13be
Renamed packages v1 to be packages.
daveverwer Jul 18, 2023
4b0157c
Tweaks to opening paragraph.
daveverwer Jul 18, 2023
654a01f
Switch to a single package list design in the CSS.
daveverwer Jul 18, 2023
808fd98
Navigation update.
daveverwer Jul 18, 2023
ba2d8a6
Link to the SWWG instead of nothing!
daveverwer Jul 18, 2023
5a84bf3
Wording on Community Showcase reasons.
daveverwer Jul 20, 2023
e28911a
SPM -> SwiftPM.
daveverwer Jul 20, 2023
f7da692
Removed unnecessary VS Code tasks file.
daveverwer Jul 20, 2023
f3f15ca
New community showcase packages.
daveverwer Jul 26, 2023
8cd2d40
Data updates for all sections.
daveverwer Jul 26, 2023
6c7d988
Split the Packages page index into an index as Markdown and the list …
daveverwer Aug 2, 2023
6fa7635
Category “more” links updated.
daveverwer Aug 7, 2023
3292ed1
Switched “showcase_reason” for notes so they can be used anywhere.
daveverwer Aug 14, 2023
96e5105
Latest data file.
daveverwer Aug 14, 2023
2bd7d69
Added two packages from Empower Apps podcast.
daveverwer Aug 14, 2023
18bb745
Replaced external link icons with freshly drawn ones.
daveverwer Aug 15, 2023
9ee609d
Removed the OSI image. It’s too small to use according to their logo …
daveverwer Aug 15, 2023
0363779
The span was load-bearing!
daveverwer Aug 15, 2023
04db02b
Formatting.
daveverwer Aug 16, 2023
e97ccdb
Added two more categories.
daveverwer Aug 16, 2023
8d0c645
Deal with packages that we don’t know compatibility for.
daveverwer Aug 16, 2023
3f8f8b9
Better naming now that the notes are not specific to the community sh…
daveverwer Aug 16, 2023
e2a57ab
Re-ordered categories.
daveverwer Aug 16, 2023
5c8d68b
Tweaked the external link icon.
daveverwer Aug 16, 2023
cbecfdb
Updated data file with feedback and some package metadata updates.
daveverwer Aug 22, 2023
3e515e5
Incorporating feedback.
daveverwer Aug 22, 2023
3eb9b5c
Added owner name into the packages data file.
daveverwer Aug 22, 2023
f178b71
Include author information in package lists.
daveverwer Aug 22, 2023
4f6bb6b
Be more explicit about how packages are picked for the showcase.
daveverwer Aug 23, 2023
b342ba0
Wording tweaks.
daveverwer Aug 23, 2023
8bdb9ad
Added “Next steps” section after forums feedback.
daveverwer Sep 7, 2023
4b4d455
Package data update with the new Community Showcase preamble.
daveverwer Sep 7, 2023
edfa7a1
Updated navigation.
daveverwer Sep 7, 2023
e710835
Final tweak to searches.
daveverwer Sep 7, 2023
fb4e86d
Merge branch 'main' into packages-page-backup
daveverwer Sep 19, 2023
5837281
Removed unused star icons.
daveverwer Sep 19, 2023
accda84
Fixed up navigation.
daveverwer Sep 19, 2023
951ec07
Unnecessary paragraphs around `markdownify`.
daveverwer Sep 19, 2023
4ca4c3d
Mobile layout.
daveverwer Sep 19, 2023
20a0bef
Use the secondary CTA style for the “more” links.
daveverwer Sep 19, 2023
f533722
The arrows are now part of the template.
daveverwer Sep 19, 2023
c5dbfe0
Fixed overlapping external link icon.
daveverwer Sep 19, 2023
d393b8f
Refreshed generated list content.
daveverwer Sep 20, 2023
1a493c0
Updated data.
daveverwer Sep 25, 2023
1b83d09
Terminology `anchor` -> `slug`.
daveverwer Sep 25, 2023
46ad349
WIP on dynamic package lists.
daveverwer Sep 25, 2023
be63576
Generate both menus with Jekyll, not JavaScript.
daveverwer Sep 26, 2023
9d7a2ad
Show only the mobile menu/desktop menu.
daveverwer Sep 26, 2023
e391a02
New category names.
daveverwer Sep 26, 2023
c037c4f
Implement the menu.
daveverwer Sep 26, 2023
d0580cb
Re-wording based on feedback.
daveverwer Sep 26, 2023
39d6d5f
Added Packages box to the homepage.
daveverwer Sep 26, 2023
c7499d4
Corrected capitalisation.
daveverwer Sep 27, 2023
7feb87b
Changed Community Showcase to New and Notable.
daveverwer Sep 27, 2023
22235ba
Merge branch 'main' into packages-page
daveverwer Sep 27, 2023
9726074
This needs to be set to false for our generator to work.
daveverwer Sep 28, 2023
da34e00
WIP on separate pages for package categories.
daveverwer Sep 28, 2023
e15bf2a
Updated gitignore to include new cache directory.
daveverwer Sep 28, 2023
6953331
Tweaked category briefs.
daveverwer Sep 28, 2023
0c19675
Clean up on the plugin code.
daveverwer Sep 28, 2023
fcb65b7
Category list design.
daveverwer Sep 28, 2023
45eab82
Wording tweaks.
daveverwer Sep 28, 2023
0f5915a
Added a Create Your Own section on the Packages page.
daveverwer Sep 28, 2023
85e825f
Added links back to the Packages page from the lists and fixed up the…
daveverwer Sep 28, 2023
fbabeca
Reconciled navigation.
daveverwer Sep 28, 2023
b8b5e4a
Link to the specific section of the Packages page from the category p…
daveverwer Sep 28, 2023
952e97c
Use the Getting Started library walkthrough instead of the Apple arti…
daveverwer Sep 28, 2023
d73bbe4
Cleaned up CSS from experiments.
daveverwer Oct 2, 2023
6176447
Match colours between category and package lists.
daveverwer Oct 2, 2023
28773b1
Package data file update.
daveverwer Oct 10, 2023
fec8c9b
Added new “Back” navigation to the top of all package category pages.
daveverwer Oct 10, 2023
7ec1143
Added “Swift” to the back link.
daveverwer Oct 10, 2023
0379487
Corrected the Swift logos.
daveverwer Oct 16, 2023
4467345
Fixed the weird cutout that ImageOptim created.
daveverwer Oct 16, 2023
dfdcce2
Finally got an accurate export of the Swift logo.
daveverwer Oct 16, 2023
c13b69f
Tweaked the Community Showcase preambles.
daveverwer Oct 30, 2023
a79b055
Removed full URL.
daveverwer Oct 31, 2023
403e84a
Updated link to forum post.
daveverwer Oct 31, 2023
c7e088c
Integrated final feedback.
daveverwer Oct 31, 2023
0376c4c
Final package data update.
daveverwer Oct 31, 2023
10ce8f2
Updated package data.
daveverwer Oct 31, 2023
8cbc471
Package data update.
daveverwer Oct 31, 2023
80200d0
Smart quotes.
daveverwer Oct 31, 2023
60a7a2c
Feedback from James.
daveverwer Oct 31, 2023
3af275c
Merge branch 'apple:main' into packages-page
daveverwer Oct 31, 2023
4ee2db1
Removed final sentence.
daveverwer Oct 31, 2023
18c196e
Removed duplicate words.
daveverwer Oct 31, 2023
232ad39
Merge branch 'packages-page' of github.com:SwiftPackageIndex/swift-or…
daveverwer Oct 31, 2023
444f068
Fixed navigation after Advanced Search section header changed.
daveverwer Oct 31, 2023
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ xcuserdata
# Built site content.
/_site

# Jekyll metadata
# Temporary Jekyll files
.jekyll-metadata
.jekyll-cache

# Asset Cache
.asset-cache
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Swift.org
description: "Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns."
timezone: America/Lower_Princes
exclude: ["README.md", "config.ru", "Gemfile", "Gemfile.lock", "Procfile", "vendor"]
safe: true
safe: false
future: true

kramdown:
Expand Down
9 changes: 9 additions & 0 deletions _data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
name: snapshots
- title: Installing Swift
name: installing-swift
- title: Packages
url: /packages/
sections:
- title: Package Ecosystem
name: package-ecosystem
- title: Create Your Own
name: create-your-own
- title: Advanced Search
name: advanced-search
- title: Platform Support
url: /platform-support/
sections:
Expand Down
497 changes: 497 additions & 0 deletions _data/packages/packages.yml

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions _plugins/package-categories.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module Jekyll
class PackageCategoriesGenerator < Generator
def generate(site)
# Generate one file per category for the Packages sub-pages
site.data.dig('packages', 'packages', 'categories').each do |category|
category_page = PageWithoutAFile.new(site, site.source, "packages", "#{category['slug']}.md")
category_page.data = {
# Front matter
'layout' => 'page',
'title' => category['name']
}
category_page.content = "{% include_relative _package-list.html category_slug=\"#{category['slug']}\" %}"
site.pages << category_page
end
end
end
end
1 change: 1 addition & 0 deletions assets/images/icon-external-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/images/icon-external.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/images/icon-swift-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 1 addition & 9 deletions assets/images/icon-swift.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions assets/images/landing-page/box.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/stylesheets/_pages.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "pages/landing";
@import "pages/getting-started";
@import "pages/swift-evolution";
@import "pages/packages";
2 changes: 1 addition & 1 deletion assets/stylesheets/pages/_landing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
grid-template-columns: repeat(1, 1fr);

@media (min-width: 1000px) {
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(4, 1fr);
}
}

Expand Down
196 changes: 196 additions & 0 deletions assets/stylesheets/pages/_packages.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
.category-list {
list-style: none;
padding-left: 0;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;

@media only screen and(max-width: 767px) {
grid-template-columns: 1fr;
}

li {
padding: 15px;
display: flex;
flex-direction: column;

p {
color: var(--color-text);
}

h3 {
line-height: 1.4;
font-size: 1.4rem;
padding-top: 0;
}

&.category {
border: 1px solid var(--color-fill-tertiary);
border-radius: 4px;

h3 {
color: var(--color-link);
}

a:hover {
text-decoration: none;

h3 {
text-decoration: underline;
}

p {
color: var(--color-secondary-label);
}
}
}

@media only screen and(min-width: 767px) {
&:first-child {
grid-column: span 2;
}
}
}
}

.package-list {
nav {
padding-bottom: 20px;

a[rel="parent"]::before {
content: "← ";
}
}

ul {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 50px 40px;
padding: 30px 0;
list-style: none;

@media only screen and(max-width: 767px) {
grid-template-columns: 1fr;
}

li {
display: grid;

&.with-note {
grid-template-rows: 5fr 1fr;
gap: 5px;
}

> a {
display: flex;
flex-direction: column;
color: inherit;
height: 100%;

&:hover {
text-decoration: none;

h4 {
background-image: url("/assets/images/icon-external-color.svg");

.name {
color: var(--color-link);
text-decoration: underline;
}
}
}
}

h4 {
display: flex;
flex-direction: column;
gap: 5px;
padding-top: 10px;
background-image: url("/assets/images/icon-external.svg");
background-repeat: no-repeat;
background-size: 15px;
background-position: top 15px right;

.name {
padding-right: 20px;
}

.owner {
font-size: 16px;
}
}

.description {
flex-grow: 1;
font-size: 16px;

> p {
// Even though this looks specific to WebKit, it works in Safari, Chrome, and Firefox.
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 6;
text-overflow: ellipsis;
overflow: hidden;
}
}

.metadata {
display: grid;
grid-template-columns: auto auto 1fr auto;
gap: 10px;

.lozenge {
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 4px;
border: 1px black solid;
font-size: 12px;
line-height: 1;
white-space: nowrap;

> span {
padding: 4px 5px;
}

&.platform-compatibility {
color: #007aff;
border-color: #007aff;

> span:not(:last-child) {
border-right: 1px solid #007aff;
}
}

&.swift-compatibility {
color: #f05138;
border-color: #f05138;

> span {
padding-left: 22px;
background-image: url("/assets/images/icon-swift-color.svg");
background-repeat: no-repeat;
background-position: 3px center;
background-size: 13px;
}
}

&.license {
grid-column: 4;
color: #3ea639;
border-color: #3ea639;
}
}
}

.note {
p {
font-size: 12px;
margin-top: 10px;
margin-bottom: 0;
color: #666666;
}
}
}
}
}
7 changes: 7 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ atom: true
Read the docs
</a>
</li>

<li>
<a href="/packages">
<img src="/assets/images/landing-page/box.svg" />
Explore packages
</a>
</li>
</ul>
</div>

Expand Down
43 changes: 43 additions & 0 deletions packages/_package-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{%- assign category = site.data.packages.packages.categories | where: "slug", include.category_slug | first %}

<section class="package-list">
<nav>
<a href="{% link packages/index.md %}#package-ecosystem" rel="parent">Explore the Swift package ecosystem</a>
</nav>

{{ category.description | markdownify }}
<ul>
{% for package in category.packages %}
<li class="{% if package.note %}with-note{% endif %}">
<a href="{{ package.url }}" target="_blank">
<h4>
<div class="name">{{ package.name }}</div>
<div class="owner">by {{ package.owner }}</div>
</h4>
<section class="description">{{ package.description | markdownify }}</section>
<section class="metadata">
{% if package.platform_compatibility %}
<div class="lozenge platform-compatibility" title="{{ package.platform_compatibility_tooltip }}">
{% for platform in package.platform_compatibility %}
<span>{{ platform }}</span>
{% endfor %}
</div>
{% endif %} {% if package.swift_compatibility %}
<div class="lozenge swift-compatibility" title="Swift version compatibility">
<span>{{ package.swift_compatibility }}</span>
</div>
{% endif %}
<div class="lozenge license" title="Package license"><span>{{ package.license }}</span></div>
</section>
</a>
{% if package.note %}
<section class="note">{{ package.note | markdownify }}</section>
{% endif %}
</li>
{%- endfor %}
</ul>

{% if category.more %}
<a class="cta-secondary" href="{{ category.more.url }}" target="_blank">{{ category.more.title }} &rsaquo;</a>
{% endif %}
</section>
19 changes: 19 additions & 0 deletions packages/_package-lists.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<ul class="category-list">
{%- for category in site.data.packages.packages.categories %}
<li class="category">
{%- assign url = "packages/" | append: category.slug | append: ".md" %}
<a href="{% link {{ url }} %}">
<h3>{{ category.name }}</h3>
<p>{{ category.brief }}</p>
</a>
</li>
{% endfor %}
<li>
<p>
There are thousands more packages to browse at the
<a href="https://swiftpackageindex.com" target="_blank">Swift Package Index</a>, along with all the metadata you
need to make better decisions about your dependencies.
</p>
<a href="https://swiftpackageindex.com" target="_blank" class="cta-secondary">Browse more packages</a>
</li>
</ul>
Loading