Skip to content

Commit 24021c9

Browse files
committed
wip: add basic event for timeline
1 parent f5e1f24 commit 24021c9

File tree

3 files changed

+42
-21
lines changed

3 files changed

+42
-21
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ dist
66

77
.build
88
.swiftpm
9-
.vscoode
9+
.vscode

Sources/App/Middlewares/SiteMiddleware.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ struct SiteMiddleware<Context: RequestContext>: RouterController {
2727
case .home:
2828
return HomePage()
2929
case .api(.activity(.all)):
30+
do {
3031
return try JSONEncoder().encode(self.activityClient.activity(), from: req, context: ctx)
32+
} catch {
33+
throw HTTPError(.forbidden)
34+
}
3135
case let .api(.activity(.location(location))):
3236
guard let auth = req.headers.authorization else {
3337
throw HTTPError(.notFound)

Sources/Pages/HomePage.swift

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ public struct HomePage: Page {
3232
AnyProperty("scale", "calc(100% * -1) 100%")
3333
}
3434

35-
self.location > Element(.span) => {
36-
Color("#fff")
37-
}
35+
// self.location > Element(.b) => {
36+
// Color("#fff")
37+
// }
3838

3939
self.educationItem => {
4040
Display(.flex)
@@ -65,7 +65,7 @@ public struct HomePage: Page {
6565
title { "Erik Bautista Santibanez" }
6666
meta(.charset(.utf8))
6767
meta(name: .viewport, content: "width=device-width, initial-scale=1.0")
68-
link(.rel(.stylesheet), .href("https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"))
68+
// link(.rel(.stylesheet), .href("https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"))
6969
style(styling)
7070
// script(.src("https://cdn.jsdelivr.net/npm/alpinejs@3.14.8/dist/cdn.min.js"), .defer) {}
7171
}
@@ -99,39 +99,51 @@ public struct HomePage: Page {
9999

100100
"Currently in "
101101

102-
span {
103-
strong {
102+
// span {
103+
b {
104104
[location.city, location.state, location.region == "United States" ? nil : location.region]
105105
.compactMap(\.self)
106106
.joined(separator: ", ")
107107
}
108-
}
108+
// }
109109
}
110110
}
111111
}
112112
}
113113
}
114114
main {
115+
article {
116+
// header {
117+
// a(.target(.blank), .rel("noopener noreferrer"), .href("https://stedwards.edu/")) {
118+
// "St. Edward's University"
119+
// }
120+
// }
121+
// p { "Bachelor of Science in Computer Science" }
122+
h6 { "Graduation" }
123+
p { "I graduated from St. Edward's University with a Bachelor of Science in Computer Science." }
124+
}
115125
// TODO: Do a timeline with filters
116126
// section(.ariaLabel("Experience")) {
117127
// h5 { "Experience" }
118128
// }
119129
// section(.ariaLabel("Projects")) {
120130
// h5 { "Projects" }
121131
// }
122-
section(.ariaLabel("Education")) {
123-
h5 { "Education" }
124-
div(.class(styling.educationItem)) {
125-
div {
126-
a(.target(.blank), .rel("noopener noreferrer"), .href("https://stedwards.edu/")) {
127-
"St. Edward's University"
128-
}
129-
p { "Bachelor of Science in Computer Science" }
130-
}
131-
132-
p { "2018-2023" }
133-
}
134-
}
132+
// section(.ariaLabel("Education")) {
133+
// h5 { "Education" }
134+
// div(.class(styling.educationItem)) {
135+
// div {
136+
// a(.target(.blank), .rel("noopener noreferrer"), .href("https://stedwards.edu/")) {
137+
// "St. Edward's University"
138+
// }
139+
// p {
140+
// i { "Bachelor of Science in Computer Science" }
141+
// }
142+
// }
143+
144+
// p { "2018-2023" }
145+
// }
146+
// }
135147
}
136148
footer(.ariaLabel("Credits")) {
137149
hr()
@@ -166,3 +178,8 @@ public struct HomePage: Page {
166178
// }
167179
// }
168180
// }
181+
182+
struct Event {
183+
let date: Date
184+
let title: String
185+
}

0 commit comments

Comments
 (0)