Skip to content

Commit

Permalink
Housekeeping (#125)
Browse files Browse the repository at this point in the history
* Add missing pages

* Add new pages to pipeline

* Remove extra tool

* Update design dependency

* Fix accessibility issues
  • Loading branch information
0xTim authored Jul 23, 2024
1 parent 08f629a commit 054ba38
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"location" : "https://github.com/vapor/design.git",
"state" : {
"branch" : "main",
"revision" : "61ca068b15e9f337b0f3b1931fa11d6c07b20084"
"revision" : "730178dfbace08c299b3699b27c1317a941d47ed"
}
},
{
Expand Down
30 changes: 30 additions & 0 deletions Sources/Website/EvangelistPage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import Plot
import Publish
import VaporDesign

struct EvangelistsPage: Component {
let context: PublishingContext<MainSite>
let isDemo: Bool

init(context: PublishingContext<MainSite>, isDemo: Bool) {
self.context = context
self.isDemo = isDemo
}

var body: any Component {
Node.body {
SiteNavigation(
context: context,
selectedSelectionID: nil,
currentSite: .main,
currentMainSitePage: .team
)
ComingSoonComponent(title: "Evangelists")
SiteFooter(
isLocal: false,
isDemo: isDemo,
currentSite: .main
)
}.class("main-site-faded-background")
}
}
43 changes: 26 additions & 17 deletions Sources/Website/HomePage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ extension HomePage {
func buildHeader() -> Component {
Div {
// Hero
Span().class("d-flex mx-auto")
Span {
Span("Vapor").class("visually-hidden")
}.class("d-flex mx-auto")
.accessibilityLabel("Vapor Logo")
.id("vapor-hero-logo")
H1("Swift, but on a server").class("main-title")
Expand All @@ -74,7 +76,7 @@ extension HomePage {
Div {
Button {
Link(url: "https://github.com/vapor/vapor") {
Span().class("vapor-icon icon-github-line icon-secondary btn-icon me-2")
Span().class("vapor-icon icon-github-line icon-secondary btn-icon me-2").attribute(named: "aria-hidden", value: "true")
Span("... stars on GitHub").id("main-page-callout-stars-count")
}.class("d-flex align-items-center")
}.class("btn btn-link btn-secondary-link")
Expand Down Expand Up @@ -112,7 +114,6 @@ extension HomePage {
Div {
H5("Powering companies like:").class("used-by-caption")
Div {
CompanyCard(name: "Emerge Tools", url: "https://emergetools.com", logo: "/images/emerge-tools.png")
CompanyCard(name: "John Lewis", url: "https://johnlewis.com", logo: "icon-john-lewis")
CompanyCard(name: "Spotify", url: "https://spotify.com", logo: "icon-spotify")
CompanyCard(name: "Swift Package Index", url: "https://swiftpackageindex.com", logo: "icon-swift-package-index")
Expand Down Expand Up @@ -220,7 +221,7 @@ extension HomePage {
Div {}.class("code-outline-left")
Div {
Div {
Span().class("vapor-icon icon-alert-octagon")
Span().class("vapor-icon icon-alert-octagon").attribute(named: "aria-hidden", value: "true")
}.class("code-error-sidebar")
Span(
"""
Expand All @@ -246,7 +247,7 @@ extension HomePage {
Button {
Link(url: "https://docs.vapor.codes/") {
Text("Get Started")
Span().class("vapor-icon icon-chevron-right")
Span().class("vapor-icon icon-chevron-right").attribute(named: "aria-hidden", value: "true")
}.linkTarget(.blank)
}.class("btn btn-primary w-mobile-100")
}.class("code-example-explainer")
Expand All @@ -267,7 +268,7 @@ extension HomePage {
Button {
Link(url: "/showcase") {
Text("See full list")
Span().class("ms-2 vapor-icon icon-chevron-right")
Span().class("ms-2 vapor-icon icon-chevron-right").attribute(named: "aria-hidden", value: "true")
}.class("text-decoration-none")
}.class("btn").class("d-none d-lg-block")
}.class("showcase-header")
Expand Down Expand Up @@ -305,10 +306,14 @@ extension HomePage {
}.class("showcase-cards scrollable").id("home-page-showcase-cards-list")
Div {
Button {
Span().class("vapor-icon icon-arrow-left")
Span {
Span("Previous Showcase").class("visually-hidden")
}.class("vapor-icon icon-arrow-left").accessibilityLabel("Previous Showcase")
}.class("arrow-button left-scroll-button")
Button {
Span().class("vapor-icon icon-arrow-right")
Span {
Span("Next Showcase").class("visually-hidden")
}.class("vapor-icon icon-arrow-right").accessibilityLabel("Next Showcase")
}.class("arrow-button right-scroll-button")
}.class("btn-group scroll-button-group").attribute(named: "data-scrollable", value: "home-page-showcase-cards-list")
}.class("row row-cols-1 row-cols-lg-2").id("showcase")
Expand Down Expand Up @@ -339,7 +344,7 @@ extension HomePage {
}.class("btn btn-primary w-mobile-100")
Link(url: "https://github.com/vapor/vapor") {
Text("Contribute")
Span().class("vapor-icon icon-chevron-right")
Span().class("vapor-icon icon-chevron-right").attribute(named: "aria-hidden", value: "true")
}.class("ms-3 learn-more-link mt-lg-0 mt-3 mb-lg-0 mb-3")
}.class("px-4 px-lg-0")
}.class("col order-2 order-lg-1 g-lg-0")
Expand All @@ -358,27 +363,27 @@ extension HomePage {
}.class("btn btn-primary w-mobile-100")
Link(url: "https://api.vapor.codes/") {
Text("Go to API Docs")
Span().class("vapor-icon icon-chevron-right")
Span().class("vapor-icon icon-chevron-right").attribute(named: "aria-hidden", value: "true")
}.class("ms-3 learn-more-link mt-lg-0 mt-3 mb-lg-0 mb-3").linkTarget(.blank)
}.class("col order-2 order-lg-1 mt-5 mt-lg-0")
Div {
Div {
H2("Get all the tools you need to build with Swift").class("d-lg-none px-4")
List {
ListItem {
Span().class("align-middle vapor-icon icon-check-circle icon-secondary me-2 d-inline-block")
Span().class("align-middle vapor-icon icon-check-circle icon-secondary me-2 d-inline-block").attribute(named: "aria-hidden", value: "true")
Span("Easily create new projects with the Vapor Toolbox").class("align-middle")
}
ListItem {
Span().class("align-middle vapor-icon icon-check-circle icon-secondary me-2 d-inline-block")
Span().class("align-middle vapor-icon icon-check-circle icon-secondary me-2 d-inline-block").attribute(named: "aria-hidden", value: "true")
Span("Expansive documentation and API reference").class("align-middle")
}
ListItem {
Span().class("align-middle vapor-icon icon-check-circle icon-secondary me-2 d-inline-block")
Span().class("align-middle vapor-icon icon-check-circle icon-secondary me-2 d-inline-block").attribute(named: "aria-hidden", value: "true")
Span("Everything you need to build backends and APIs").class("align-middle")
}
ListItem {
Span().class("align-middle vapor-icon icon-check-circle icon-secondary me-2 d-inline-block")
Span().class("align-middle vapor-icon icon-check-circle icon-secondary me-2 d-inline-block").attribute(named: "aria-hidden", value: "true")
Span("Full support for Swift's concurrency model").class("align-middle")
}
}.class("px-4 p-lg-0")
Expand Down Expand Up @@ -418,11 +423,15 @@ extension HomePage {
}.class("sponsors-list").id("home-page-sponsors-list")
Div {
Button {
Span().class("vapor-icon icon-arrow-left")
Span {
Span("Previous Sponsors").class("visually-hidden")
}.class("vapor-icon icon-arrow-left").accessibilityLabel("Previous Sponsors")
}.class("arrow-button left-scroll-button")
Button {
Span().class("vapor-icon icon-arrow-right")
}.class("arrow-button right-scroll-button")
Span {
Span("Next Sponsors").class("visually-hidden")
}.class("vapor-icon icon-arrow-right")
}.class("arrow-button right-scroll-button").accessibilityLabel("Next Sponsors")
}.class("btn-group scroll-button-group").attribute(named: "data-scrollable", value: "home-page-sponsors-list")
}.class("row").id("sponsors")
}.class("container")
Expand Down
30 changes: 30 additions & 0 deletions Sources/Website/SupportersPage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import Plot
import Publish
import VaporDesign

struct SupportersPage: Component {
let context: PublishingContext<MainSite>
let isDemo: Bool

init(context: PublishingContext<MainSite>, isDemo: Bool) {
self.context = context
self.isDemo = isDemo
}

var body: any Component {
Node.body {
SiteNavigation(
context: context,
selectedSelectionID: nil,
currentSite: .main,
currentMainSitePage: .team
)
ComingSoonComponent(title: "Supporters")
SiteFooter(
isLocal: false,
isDemo: isDemo,
currentSite: .main
)
}.class("main-site-faded-background")
}
}
8 changes: 8 additions & 0 deletions Sources/Website/Theme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ struct VaporHomePageThemeHTMLFactory: HTMLFactory {
ShowcasePage(context: context, isDemo: isDemo)
case .team:
TeamPage(context: context, isDemo: isDemo)
case .supporters:
SupportersPage(context: context, isDemo: isDemo)
case .evangelists:
EvangelistsPage(context: context, isDemo: isDemo)
default:
HomePage(context: context, isDemo: isDemo)
}
Expand All @@ -85,6 +89,10 @@ struct VaporHomePageThemeHTMLFactory: HTMLFactory {
.showcase
case "/team", "/team/", "team":
.team
case "/evangelists", "/evangelists/", "evangelists":
.evangelists
case "/supporters", "/supporters/", "supporters":
.supporters
default:
.home
}
Expand Down

0 comments on commit 054ba38

Please sign in to comment.