Skip to content

Commit 3083d58

Browse files
authored
⬆️ Update Ignite and apply migration to fix layout issues (#71)
1 parent 20fb617 commit 3083d58

22 files changed

+47
-55
lines changed
Loading

Website/Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let package = Package(
88
defaultLocalization: "en",
99
platforms: [.macOS(.v14)],
1010
dependencies: [
11-
.package(url: "https://github.com/twostraws/Ignite", revision: "3080060aca91fe431b31d4a9b2bba2a99d81b25a"),
11+
.package(url: "https://github.com/twostraws/Ignite", revision: "df775025a896a7adb26c46563201cc0c6d36d91d"),
1212
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.2.0"),
1313
.package(path: "../MyLibrary")
1414
],

Website/Sources/Components/AccessComponent.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Ignite
22

3-
struct AccessComponent: RootHTML {
3+
struct AccessComponent: DocumentElement {
44
let language: SupportedLanguage
55
private let venueMapUrl = "https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d12959.484415464616!2d139.4122493!3d35.7047894!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6018e16a387013a3%3A0xcd9c50e33a16ff6b!2sTachikawa%20Stage%20Garden!5e0!3m2!1sen!2sjp!4v1720059016768!5m2!1sen!2sjp"
66
private let accommodationMapUrl = "https://www.google.com/maps/d/u/0/embed?mid=1mBsqxzE2L_guJrg7nE96dJBlJUrZVoA&ehbc=2E312F&noprof=1"

Website/Sources/Components/Border.swift

-10
This file was deleted.

Website/Sources/Components/HeaderComponent.swift

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Ignite
22

3-
struct HeaderComponent: RootHTML {
3+
struct HeaderComponent: DocumentElement {
44
let language: SupportedLanguage
55

66
var body: some HTML {
@@ -11,28 +11,28 @@ struct HeaderComponent: RootHTML {
1111
.frame(width: .percent(100%), height: .percent(100%))
1212
.ignorePageGutters(false)
1313
Section {
14-
Section {
15-
Image("/images/title.png", description: "title image")
16-
.resizable()
17-
.aspectRatio(260 / 100, contentMode: .fit)
18-
.frame(width: .percent(50%))
19-
.margin(.top, .px(100))
20-
}
21-
.frame(width: .percent(100%))
22-
.ignorePageGutters(false)
14+
Image("/images/title.png", description: "title image")
15+
.resizable()
16+
.aspectRatio(260 / 100, contentMode: .fit)
17+
.frame(width: .percent(50%))
18+
.margin(.top, .px(100))
19+
.margin(.horizontal, .percent(25%))
20+
.ignorePageGutters(false)
21+
2322
ZStack(alignment: .bottom) {
2423
Section {
2524
Spacer()
2625
Image("/images/intersect.svg", description: "decoration image of header")
2726
.resizable()
27+
.margin(.bottom, .px(-1))
2828
}
2929
Text(String("About", language: language))
3030
.font(.title1)
3131
.fontWeight(.bold)
3232
.foregroundStyle(.bootstrapPurple)
3333
.margin(.bottom, .percent(2%))
3434
}
35-
.horizontalAlignment(.center)
35+
.frame(alignment: .init(horizontal: .center))
3636
.ignorePageGutters(false)
3737
}
3838
}.background(.darkBlue)

Website/Sources/Components/LanguageSelector.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Ignite
22

3-
struct LanguageSelector: HTML, InlineHTML {
3+
struct LanguageSelector: HTML, InlineElement {
44
let path: (SupportedLanguage) -> String
55
let currentLanguage: SupportedLanguage
66

Website/Sources/Components/MainFooter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Ignite
33

4-
struct MainFooter: RootHTML {
4+
struct MainFooter: DocumentElement {
55
let language: SupportedLanguage
66

77
var body: some HTML {

Website/Sources/Components/OrganizerComponent.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct OrganizerModel: HTML {
4545
.fontWeight(.regular)
4646
.foregroundStyle(.dimGray)
4747
if let links = organizer.links {
48-
Row {
48+
Section {
4949
ForEach(links) { link in
5050
Link(link.name, target: link.url)
5151
.target(.newWindow)

Website/Sources/Components/SectionHeader.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ struct SectionHeader: HTML {
66

77
var body: some HTML {
88
ZStack(alignment: .center) {
9-
Border(hex: "#6f42c1")
109
Text(String(type.rawValue, language: language))
1110
.horizontalAlignment(.center)
1211
.font(.title1)
1312
.fontWeight(.bold)
1413
.foregroundStyle(.bootstrapPurple)
1514
}
1615
.padding(.top, .px(80))
17-
.padding(.bottom, .px(16))
16+
.padding(.bottom, .px(32))
17+
.margin(.bottom, .px(32))
18+
.border(.bootstrapPurple, width: 2, edges: .bottom)
1819
.id(type.htmlId)
1920
}
2021
}

Website/Sources/Components/SpeakerDetailComponent.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct SpeakerDetailComponent: HTML {
2727
.foregroundStyle(.dimGray)
2828
}
2929
if let links = speaker.links {
30-
Row {
30+
Section {
3131
ForEach(links) { link in
3232
Link(link.name, target: link.url)
3333
.target(.newWindow)

Website/Sources/Components/SponsorComponent.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct SponsorComponent: HTML {
88
let language: SupportedLanguage
99

1010
var body: some HTML {
11-
var image: any InlineHTML {
11+
var image: any InlineElement {
1212
Image(sponsor.imageFilename, description: sponsor.name ?? "sponsor logo")
1313
.resizable()
1414
.frame(maxWidth: Int(size.width), maxHeight: Int(size.height))

Website/Sources/Components/TicketsComponent.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ struct TicketsComponent: HTML {
1616
title: String("Tickets", language: language),
1717
url: "https://lu.ma/embed/event/evt-iaERdyhafeQdV5f/simple"
1818
)
19-
.aspectRatio(.square)
19+
.aspectRatio(0.75)
20+
.frame(height: .px(1_800))
2021
.margin(.bottom, .px(120))
2122
Text(String("The latest information is announced on X", language: language))
2223
.font(.title3)

Website/Sources/Components/TimetableComponent.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22
import Ignite
33
import SharedModels
44

5-
struct TimetableComponent: RootHTML {
5+
struct TimetableComponent: DocumentElement {
66
let conference: Conference
77
let language: SupportedLanguage
88
private let imageSize = 50

Website/Sources/ConferenceWebsite.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Ignite
55
@main
66
struct ConferenceWebsite {
77
static func main() async {
8-
let site = ConferenceSite2025()
8+
var site = ConferenceSite2025()
99

1010
do {
1111
try copyAssets()
@@ -77,7 +77,7 @@ struct ConferenceSite2025: Site {
7777
var darkTheme: (any Theme)? = nil
7878
var favicon = URL(string: "/images/favicon.png")
7979

80-
var staticLayouts: [any StaticLayout] {
80+
var staticPages: [any StaticPage] {
8181
for language in SupportedLanguage.allCases {
8282
Home(language: language)
8383
FAQ(language: language)
@@ -88,7 +88,7 @@ struct ConferenceSite2025: Site {
8888
}
8989
}
9090

91-
private struct LegacyHome: StaticLayout {
91+
private struct LegacyHome: StaticPage {
9292
let title = ""
9393
var path = "/_en"
9494

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import Ignite
22

33
struct MainLayout: Layout {
4-
@Environment(\.siteConfiguration) private var siteConfiguration
4+
@Environment(\.page) private var currentPage
55
let title: String
66
let ogpLink: String
77

88
var body: some HTML {
9-
HTMLDocument {
10-
HTMLHead(for: page, with: siteConfiguration) {
11-
MetaTag(property: "og:image", content: ogpLink)
12-
MetaTag(name: "twitter:title", content: title)
13-
MetaTag(name: "twitter:image", content: ogpLink)
9+
Head {
10+
MetaTag(.openGraphTitle, content: title)
11+
MetaTag(.openGraphImage, content: ogpLink)
12+
MetaTag(.twitterTitle, content: title)
13+
MetaTag(.twitterImage, content: ogpLink)
1414

15-
if page.url.pathComponents.last == "_en" {
16-
RedirectMetaTag(to: URL(string: page.url.absoluteString.replacingOccurrences(of: "_", with: ""))!)
17-
}
15+
if currentPage.url.pathComponents.last == "_en" {
16+
let redirectUrl = URL(string: currentPage.url.absoluteString.replacingOccurrences(of: "_", with: ""))!
17+
RedirectMetaTag(to: redirectUrl)
1818
}
19+
}
1920

20-
HTMLBody {
21-
Section(page.body)
22-
}.class("container")
21+
Body {
22+
content
2323
}
2424
}
2525
}

Website/Sources/Layouts/RedirectMetaTag.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ struct RedirectMetaTag: HeadElement, Sendable {
44
let to: URL
55
var body: some HTML { self }
66

7-
func render(context: PublishingContext) -> String {
7+
func render() -> String {
88
"""
99
<meta http-equiv="refresh" content="0;url=\(to.absoluteString)">
1010
"""

Website/Sources/Pages/CodeOfConduct.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension CodeOfConductSectionType {
2222
}
2323
}
2424

25-
struct CodeOfConduct: StaticLayout {
25+
struct CodeOfConduct: StaticPage {
2626
let language: SupportedLanguage
2727
let title: String
2828

Website/Sources/Pages/FAQ.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension FAQSectionType {
2626
}
2727
}
2828

29-
struct FAQ: StaticLayout {
29+
struct FAQ: StaticPage {
3030
let language: SupportedLanguage
3131
let title: String
3232

Website/Sources/Pages/Home.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Foundation
44
import Ignite
55
import SharedModels
66

7-
struct Home: StaticLayout {
7+
struct Home: StaticPage {
88
let language: SupportedLanguage
99
var title = ""
1010

Website/Sources/Pages/HomeSections.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ extension HomeSectionType {
6666
}
6767

6868
Alert {
69-
speakers.map { speaker in
69+
ForEach(speakers) { speaker in
7070
SpeakerModal(speaker: speaker, language: language)
7171
}
7272
}
@@ -123,7 +123,7 @@ extension HomeSectionType {
123123
}
124124

125125
Alert {
126-
organizers.map { organizer in
126+
ForEach(organizers) { organizer in
127127
OrganizerModel(organizer: organizer, language: language)
128128
}
129129
}

Website/Sources/Pages/PrivacyPolicy.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension PrivacyPolicySectionType {
2626
}
2727
}
2828

29-
struct PrivacyPolicy: StaticLayout {
29+
struct PrivacyPolicy: StaticPage {
3030
let language: SupportedLanguage
3131
let title: String
3232

trySwiftTokyo.xcworkspace/xcshareddata/swiftpm/Package.resolved

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"location" : "https://github.com/twostraws/Ignite",
1616
"state" : {
1717
"branch" : "main",
18-
"revision" : "3080060aca91fe431b31d4a9b2bba2a99d81b25a"
18+
"revision" : "df775025a896a7adb26c46563201cc0c6d36d91d"
1919
}
2020
},
2121
{

0 commit comments

Comments
 (0)