Skip to content

Commit e4ca20e

Browse files
committed
wip: improve hero code presentation
1 parent 99482bf commit e4ca20e

File tree

1 file changed

+44
-26
lines changed

1 file changed

+44
-26
lines changed

Sources/Pages/HomePage.swift

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public struct HomePage: Page {
3333
VueScript()
3434
}
3535
body {
36-
// TODO: Add header to switch between posts and something else?
36+
// TODO: Add header to switch between posts and swich from cod?
3737
main {
3838
UserHero()
3939
PostsSection()
@@ -61,6 +61,7 @@ public struct HomePage: Page {
6161
hgroup(.class("container-content")) {
6262
// h1(.class("hero-title")) { "Erik Bautista Santibanez" }
6363
// p(.class("hero-subtitle")) { "Mobile & Web Developer" }
64+
// p { residency }
6465
// p { location }
6566

6667
pre {
@@ -73,27 +74,39 @@ public struct HomePage: Page {
7374
span(.class("hljs-title class_")) { "User" }
7475
": "
7576
span(.class("hljs-title class_")) { "Portfolio" }
76-
" {\n"
77-
span(.class("hljs-keyword")) { HTMLRaw("  var") }
77+
" {\n "
78+
span(.class("hljs-keyword")) { "var" }
7879
" body: "
7980
span(.class("hljs-keyword")) { "some" }
8081
" "
8182
span(.class("hljs-type")) { "Description" }
82-
" { \n"
83-
span(.class("hljs-type")) { HTMLRaw("    Name") }
83+
" { \n "
84+
span(.class("hljs-type")) { "Name" }
8485
"("
85-
span(.class("hero-title hljs-string")) { "\"Erik Bautista Santibanez\"" }
86-
")\n"
87-
span(.class("hljs-type")) { HTMLRaw("    Role") }
86+
span(.class("hljs-string")) {
87+
"\""
88+
span(.class("hero-title")) { "Erik Bautista Santibanez" }
89+
"\""
90+
}
91+
")\n "
92+
span(.class("hljs-type")) { "Role" }
8893
"("
89-
span(.class("hero-subtitle hljs-string")) { "\"Mobile & Web Developer\"" }
90-
")\n"
91-
span(.class("hljs-type")) { HTMLRaw("    Home") }
94+
span(.class("hljs-string")) {
95+
"\""
96+
span(.class("hero-subtitle")) { "Mobile & Web Developer" }
97+
"\""
98+
}
99+
")\n "
100+
span(.class("hljs-type")) { "Home" }
92101
"("
93-
span(.class("hero-location hljs-string")) { "\""; self.residency; "\"" }
102+
span(.class("hljs-string")) {
103+
"\""
104+
span(.class("hero-location")) { self.residency }
105+
"\""
106+
}
94107
")\n"
95108
location
96-
HTMLRaw("  }\n")
109+
HTMLRaw(" }\n")
97110
"}"
98111
}
99112
}
@@ -120,23 +133,28 @@ public struct HomePage: Page {
120133
let residency = location?.residency ?? .default
121134

122135
if let location, location.city != residency.city || location.state != residency.state {
123-
span(.class("hljs-type")) { HTMLRaw("    Location") }
124-
"(\""
125-
span(.class("hero-location"), .aria.label("Location")) {
126-
svg(.xmlns(), .fill("currentColor"), .viewBox("0 0 256 256"), .class("svg-icon reversed"), .aria.label("Navigation icon")) {
127-
path(.d("M234.35,129,152,152,129,234.35a8,8,0,0,1-15.21.27l-65.28-176A8,8,0,0,1,58.63,48.46l176,65.28A8,8,0,0,1,234.35,129Z"))
128-
path(.d("M237.33,106.21,61.41,41l-.16-.05A16,16,0,0,0,40.9,61.25a1,1,0,0,0,.05.16l65.26,175.92A15.77,15.77,0,0,0,121.28,248h.3a15.77,15.77,0,0,0,15-11.29l.06-.2,21.84-78,78-21.84.2-.06a16,16,0,0,0,.62-30.38ZM149.84,144.3a8,8,0,0,0-5.54,5.54L121.3,232l-.06-.17L56,56l175.82,65.22.16.06Z"))
129-
}
136+
" "
137+
span(.class("hljs-type")) { "Location" }
138+
"("
139+
span(.class("hljs-string")) {
140+
"\""
141+
span(.class("hero-location"), .aria.label("Location")) {
142+
svg(.xmlns(), .fill("currentColor"), .viewBox("0 0 256 256"), .class("svg-icon reversed"), .aria.label("Navigation icon")) {
143+
path(.d("M234.35,129,152,152,129,234.35a8,8,0,0,1-15.21.27l-65.28-176A8,8,0,0,1,58.63,48.46l176,65.28A8,8,0,0,1,234.35,129Z"))
144+
path(.d("M237.33,106.21,61.41,41l-.16-.05A16,16,0,0,0,40.9,61.25a1,1,0,0,0,.05.16l65.26,175.92A15.77,15.77,0,0,0,121.28,248h.3a15.77,15.77,0,0,0,15-11.29l.06-.2,21.84-78,78-21.84.2-.06a16,16,0,0,0,.62-30.38ZM149.84,144.3a8,8,0,0,0-5.54,5.54L121.3,232l-.06-.17L56,56l175.82,65.22.16.06Z"))
145+
}
130146

131-
"Currently in "
147+
"Currently in "
132148

133-
b {
134-
[location.city, location.state, location.region == "United States" ? nil : location.region]
135-
.compactMap(\.self)
136-
.joined(separator: ", ")
149+
b {
150+
[location.city, location.state, location.region == "United States" ? nil : location.region]
151+
.compactMap(\.self)
152+
.joined(separator: ", ")
153+
}
137154
}
155+
"\""
138156
}
139-
"\")\n"
157+
")\n"
140158
} else {
141159
EmptyHTML()
142160
}

0 commit comments

Comments
 (0)