Skip to content

Commit 816a416

Browse files
committed
Layout tweak.
1 parent 4d08f14 commit 816a416

File tree

2 files changed

+70
-40
lines changed

2 files changed

+70
-40
lines changed

FrontEnd/styles/layout.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ main > .inner {
4747
}
4848
}
4949

50+
.center-column {
51+
display: flex;
52+
flex-direction: column;
53+
align-items: center;
54+
max-width: 700px;
55+
margin: 0 auto;
56+
}
57+
5058
@media screen and (max-width: $mobile-breakpoint) {
5159
.two-column {
5260
display: flex;

Sources/App/Views/Home/HomeIndex+View.swift

Lines changed: 62 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -56,51 +56,73 @@ enum HomeIndex {
5656
}
5757

5858
override func content() -> Node<HTML.BodyContext> {
59-
.section(
60-
.class("two-column"),
59+
.if(Current.environment() == .production,
6160
.section(
62-
.if(Current.environment() == .production,
63-
.panelButton(cssClass: "podcast",
64-
linkUrl: ExternalURL.podcast,
65-
bodyNode: .podcastPanelBody(includeHeading: false),
66-
cta: "Listen Now",
67-
analyticsEvent: "Home - Podcast CTA"),
68-
else:
69-
.panelButton(cssClass: "rfs6",
70-
linkUrl: SiteURL.readyForSwift6.relativeURL(),
71-
bodyNode: .group(
72-
.p(
73-
.strong("Are the packages you use safe from data races?"),
74-
.text(" "),
75-
.text("We’re tracking progress towards data race safety this summer. Find out which packages are “Ready for Swift 6” and check for packages marked as “Safe from data races” when browsing the index.")
76-
)
77-
),
78-
cta: "Track Progress",
79-
analyticsEvent: "Home - Ready for Swift 6 CTA")
61+
.class("two-column"),
62+
.section(
63+
homePageCTA(),
64+
recentPackageLists()
8065
),
8166
.section(
82-
.class("recent"),
83-
.div(
84-
.class("recent_packages"),
85-
.h3("Recently Added"),
86-
.ul(model.recentPackagesSection())
87-
),
88-
.div(
89-
.class("recent_releases"),
90-
.h3("Recent Releases"),
91-
.ul(model.recentReleasesSection())
92-
)
67+
supporterSidebar()
9368
)
9469
),
95-
.section(
96-
.class("supporter-ctas"),
97-
.panelButton(cssClass: "scta",
98-
linkUrl: SiteURL.supporters.relativeURL(),
99-
bodyNode: .sponsorsCtaBody(),
100-
analyticsEvent: "Home - Supporters CTA"),
101-
.group(
102-
Supporters.corporate.shuffled().map(\.advertisementNode)
103-
)
70+
else: .section(
71+
.class("center-column"),
72+
homePageCTA(),
73+
recentPackageLists()
74+
)
75+
)
76+
}
77+
78+
func homePageCTA() -> Node<HTML.BodyContext> {
79+
.section(
80+
.if(Current.environment() == .production,
81+
.panelButton(cssClass: "podcast",
82+
linkUrl: ExternalURL.podcast,
83+
bodyNode: .podcastPanelBody(includeHeading: false),
84+
cta: "Listen Now",
85+
analyticsEvent: "Home - Podcast CTA"),
86+
else: .panelButton(cssClass: "rfs6",
87+
linkUrl: SiteURL.readyForSwift6.relativeURL(),
88+
bodyNode: .group(
89+
.p(
90+
.strong("Are the packages you use safe from data races?"),
91+
.text(" "),
92+
.text("We’re tracking progress towards data race safety this summer. Find out which packages are “Ready for Swift 6” and check for packages marked as “Safe from data races” when browsing the index.")
93+
)
94+
),
95+
cta: "Track Progress",
96+
analyticsEvent: "Home - Ready for Swift 6 CTA")
97+
)
98+
)
99+
}
100+
101+
func recentPackageLists() -> Node<HTML.BodyContext> {
102+
.section(
103+
.class("recent"),
104+
.div(
105+
.class("recent_packages"),
106+
.h3("Recently Added"),
107+
.ul(model.recentPackagesSection())
108+
),
109+
.div(
110+
.class("recent_releases"),
111+
.h3("Recent Releases"),
112+
.ul(model.recentReleasesSection())
113+
)
114+
)
115+
}
116+
117+
func supporterSidebar() -> Node<HTML.BodyContext> {
118+
.section(
119+
.class("supporter-ctas"),
120+
.panelButton(cssClass: "scta",
121+
linkUrl: SiteURL.supporters.relativeURL(),
122+
bodyNode: .sponsorsCtaBody(),
123+
analyticsEvent: "Home - Supporters CTA"),
124+
.group(
125+
Supporters.corporate.shuffled().map(\.advertisementNode)
104126
)
105127
)
106128
}

0 commit comments

Comments
 (0)