From 054ba38840bd96feaa69a8f6d295dd7ee420a3cf Mon Sep 17 00:00:00 2001 From: Tim Condon <0xTim@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:09:46 +0100 Subject: [PATCH] Housekeeping (#125) * Add missing pages * Add new pages to pipeline * Remove extra tool * Update design dependency * Fix accessibility issues --- Package.resolved | 2 +- Sources/Website/EvangelistPage.swift | 30 +++++++++++++++++++ Sources/Website/HomePage.swift | 43 +++++++++++++++++----------- Sources/Website/SupportersPage.swift | 30 +++++++++++++++++++ Sources/Website/Theme.swift | 8 ++++++ 5 files changed, 95 insertions(+), 18 deletions(-) create mode 100644 Sources/Website/EvangelistPage.swift create mode 100644 Sources/Website/SupportersPage.swift diff --git a/Package.resolved b/Package.resolved index a9acb49..cdc2671 100644 --- a/Package.resolved +++ b/Package.resolved @@ -25,7 +25,7 @@ "location" : "https://github.com/vapor/design.git", "state" : { "branch" : "main", - "revision" : "61ca068b15e9f337b0f3b1931fa11d6c07b20084" + "revision" : "730178dfbace08c299b3699b27c1317a941d47ed" } }, { diff --git a/Sources/Website/EvangelistPage.swift b/Sources/Website/EvangelistPage.swift new file mode 100644 index 0000000..fbec827 --- /dev/null +++ b/Sources/Website/EvangelistPage.swift @@ -0,0 +1,30 @@ +import Plot +import Publish +import VaporDesign + +struct EvangelistsPage: Component { + let context: PublishingContext + let isDemo: Bool + + init(context: PublishingContext, 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") + } +} diff --git a/Sources/Website/HomePage.swift b/Sources/Website/HomePage.swift index 5f42a45..32b6c2f 100644 --- a/Sources/Website/HomePage.swift +++ b/Sources/Website/HomePage.swift @@ -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") @@ -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") @@ -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") @@ -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( """ @@ -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") @@ -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") @@ -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") @@ -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") @@ -358,7 +363,7 @@ 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 { @@ -366,19 +371,19 @@ extension HomePage { 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") @@ -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") diff --git a/Sources/Website/SupportersPage.swift b/Sources/Website/SupportersPage.swift new file mode 100644 index 0000000..518f8e3 --- /dev/null +++ b/Sources/Website/SupportersPage.swift @@ -0,0 +1,30 @@ +import Plot +import Publish +import VaporDesign + +struct SupportersPage: Component { + let context: PublishingContext + let isDemo: Bool + + init(context: PublishingContext, 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") + } +} diff --git a/Sources/Website/Theme.swift b/Sources/Website/Theme.swift index cc0fb38..9acaa5a 100644 --- a/Sources/Website/Theme.swift +++ b/Sources/Website/Theme.swift @@ -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) } @@ -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 }