Skip to content

Commit b149d4d

Browse files
Add contact and about pages
1 parent 774e9c6 commit b149d4d

File tree

6 files changed

+148
-106
lines changed

6 files changed

+148
-106
lines changed

src/build.gleam

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import gleam/dict
1+
import website/page/contact
2+
import website/page/commissions
23
import gleam/io
3-
import gleam/list
44
import lustre/ssg
5-
import website/data/projects
65
import website/page/about
76
import website/page/index
8-
import website/page/project
97

108
pub fn main() {
119
// let posts =
@@ -18,6 +16,8 @@ pub fn main() {
1816
ssg.new("./priv")
1917
|> ssg.add_static_route("/", index.view())
2018
|> ssg.add_static_route("/about", about.view())
19+
|> ssg.add_static_route("/commissions", commissions.view())
20+
|> ssg.add_static_route("/contact", contact.view())
2121
|> ssg.add_static_dir("./static")
2222
// |> ssg.add_static_route("/blog", blog.view(posts.all()))
2323
// |> ssg.add_dynamic_route("/blog", posts, post.view)

src/website/component.gleam

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import website/component/footer
21
import lustre/attribute.{attribute}
32
import lustre/element.{type Element}
43
import lustre/element/html
4+
import website/component/footer
55
import website/component/header
66

77
pub fn head(page: String) -> Element(a) {
@@ -43,3 +43,21 @@ pub fn page(name: String, content: List(Element(a))) -> Element(a) {
4343
]),
4444
])
4545
}
46+
47+
pub fn text_page(
48+
title: String,
49+
header: String,
50+
content: List(Element(a)),
51+
) -> Element(a) {
52+
page(title, [
53+
html.div([attribute.class("mx-auto max-w-3xl")], [
54+
html.h1(
55+
[attribute.class("text-3xl font-bold leading-tight text-center")],
56+
[html.text(header)],
57+
),
58+
]),
59+
html.div([attribute.class("mx-auto max-w-4xl py-8 leading-8")], [
60+
html.p([attribute.class("text-xl")], content),
61+
]),
62+
])
63+
}

src/website/page/about.gleam

Lines changed: 37 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,43 @@ import lustre/element/html
33
import website/component
44

55
pub fn view() {
6-
component.page("About", [
7-
html.div([attribute.class("mx-auto max-w-3xl")], [
8-
html.h1(
9-
[attribute.class("text-3xl font-bold leading-tight text-center")],
10-
[html.text("About me")],
6+
component.text_page("About", "About me", [
7+
html.span([attribute.class("text-2xl font-bold")], [
8+
html.text(
9+
"I'm Gears; a programmer, Minecraft enthusiast, YouTuber and nerd.",
10+
),
11+
]),
12+
html.br([]),
13+
html.br([]),
14+
html.text(
15+
"The programming language I know most about, and therefore use the most, is JavaScript/TypeScript. However, I also know Ruby, MCFunction and Golang, and dabble in Rust and Python.",
1116
),
12-
]),
13-
html.div(
14-
[attribute.class("mx-auto max-w-4xl py-8 leading-8")],
15-
[
16-
html.p([attribute.class("text-xl")], [
17-
html.span([attribute.class("text-2xl font-bold")], [
18-
html.text(
19-
"I'm Gears; a programmer, Minecraft enthusiast, YouTuber and nerd.",
20-
),
21-
]),
22-
html.br([]),
23-
html.br([]),
24-
html.text(
25-
"The programming language I know most about, and therefore use the most, is JavaScript/TypeScript. However, I also know Ruby, MCFunction and Golang, and dabble in Rust and Python.",
26-
),
27-
html.br([]),
28-
html.text("I make "),
29-
html.a(
30-
[
31-
attribute.target("_blank"),
32-
attribute.class("text-blue-500 underline"),
33-
attribute.href("https://youtube.com/@Gearsdatapacks"),
34-
],
35-
[html.text("YouTube videos")],
36-
),
37-
html.text(
38-
" about my ongoing struggle with Minecraft datapacks, as well as other fun Minecraft content.",
39-
),
40-
html.br([]),
41-
html.text(
42-
"Projects I've made include a programming language with Minecraft datapacks (not alone), and a Datapack Package Manager.",
43-
),
44-
html.br([]),
45-
html.text("More information on the "),
46-
html.a(
47-
[
48-
attribute.class("font-bold hover:underline"),
49-
attribute.href("/projects/"),
50-
],
51-
[html.text("projects")],
52-
),
53-
html.text("page."),
54-
]),
55-
],
56-
),
17+
html.br([]),
18+
html.text("I make "),
19+
html.a(
20+
[
21+
attribute.target("_blank"),
22+
attribute.class("text-blue-500 underline"),
23+
attribute.href("https://youtube.com/@Gearsdatapacks"),
24+
],
25+
[html.text("YouTube videos")],
26+
),
27+
html.text(
28+
" about my ongoing struggle with Minecraft datapacks, as well as other fun Minecraft content.",
29+
),
30+
html.br([]),
31+
html.text(
32+
"Projects I've made include a programming language with Minecraft datapacks (not alone), and a Datapack Package Manager.",
33+
),
34+
html.br([]),
35+
html.text("More information on the "),
36+
html.a(
37+
[
38+
attribute.class("font-bold hover:underline"),
39+
attribute.href("/projects/"),
40+
],
41+
[html.text("projects")],
42+
),
43+
html.text("page."),
5744
])
5845
}

src/website/page/commissions.gleam

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import lustre/attribute.{attribute}
2+
import lustre/element/html
3+
import website/component
4+
5+
pub fn view() {
6+
component.text_page("Commissions", "Datapack commissions", [
7+
html.text(
8+
"Among other things, I make paid datapacks for people.
9+
If you would like me to make you a datapack, please ",
10+
),
11+
html.a(
12+
[
13+
attribute.class("hover:underline font-bold"),
14+
attribute.href("/contact/"),
15+
],
16+
[html.text("contact me")],
17+
),
18+
html.text(
19+
".",
20+
),
21+
html.span([attribute.class("absolute right-10 bottom-20 text-slate-800")], [
22+
html.text("Hi :)"),
23+
]),
24+
])
25+
}

src/website/page/contact.gleam

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import lustre/attribute.{attribute}
2+
import lustre/element/html
3+
import website/component
4+
5+
pub fn view() {
6+
component.text_page("Contact", "Contact me", [
7+
html.text(
8+
"If you have questions you want to ask, or want to reach out to me, you can send me an email at ",
9+
),
10+
html.a(
11+
[
12+
attribute.class("font-bold text-orange-400"),
13+
attribute.href("mailto:[email protected]"),
14+
],
15+
[html.text("[email protected]")],
16+
),
17+
html.text(
18+
",
19+
or join my ",
20+
),
21+
html.a(
22+
[
23+
attribute.target("_blank"),
24+
attribute.class("underline text-blue-700"),
25+
attribute.href("https://discord.gg/fmPKDqf9ze"),
26+
],
27+
[html.text("Discord server")],
28+
),
29+
html.text("."),
30+
])
31+
}

src/website/page/index.gleam

Lines changed: 32 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,38 @@ import lustre/element/html
33
import website/component
44

55
pub fn view() {
6-
component.page("Home", [
7-
html.div([attribute.class("mx-auto max-w-3xl")], [
8-
html.h1(
9-
[attribute.class("text-3xl font-bold leading-tight text-center")],
10-
[html.text("Hello and welcome to my website!")],
6+
component.text_page("Home", "Hello and welcome to my website!", [
7+
html.text("I am Gears, a software developer and Minecraft YouTuber."),
8+
html.br([]),
9+
html.text("More about me in the "),
10+
html.a(
11+
[attribute.href("/about/"), attribute.class("underline font-bold")],
12+
[html.text("about")],
1113
),
12-
]),
13-
html.div(
14-
[attribute.class("mx-auto max-w-4xl py-8 leading-8")],
15-
[
16-
html.p([attribute.class("text-xl")], [
17-
html.text("I am Gears, a software developer and Minecraft YouTuber."),
18-
html.br([]),
19-
html.text("More about me in the "),
20-
html.a(
21-
[attribute.href("/about/"), attribute.class("underline font-bold")],
22-
[html.text("about")],
23-
),
24-
html.text(" section."),
25-
html.br([]),
26-
html.text("You can check out my finished and ongoing projects in "),
27-
html.a(
28-
[
29-
attribute.href("/projects/"),
30-
attribute.class("underline font-bold"),
31-
],
32-
[html.text("projects")],
33-
),
34-
html.text("."),
35-
html.br([]),
36-
html.text("For information on Minecraft datapack commissions, see "),
37-
html.a(
38-
[
39-
attribute.href("/commissions/"),
40-
attribute.class("underline font-bold"),
41-
],
42-
[html.text("commissions")],
43-
),
44-
html.text("."),
45-
html.br([]),
46-
html.text("If you have more questions, you can "),
47-
html.a(
48-
[
49-
attribute.href("/contact/"),
50-
attribute.class("underline font-bold"),
51-
],
52-
[html.text("contact me")],
53-
),
54-
html.text("."),
55-
]),
56-
],
57-
),
14+
html.text(" section."),
15+
html.br([]),
16+
html.text("You can check out my finished and ongoing projects in "),
17+
html.a(
18+
[attribute.href("/projects/"), attribute.class("underline font-bold")],
19+
[html.text("projects")],
20+
),
21+
html.text("."),
22+
html.br([]),
23+
html.text("For information on Minecraft datapack commissions, see "),
24+
html.a(
25+
[
26+
attribute.href("/commissions/"),
27+
attribute.class("underline font-bold"),
28+
],
29+
[html.text("commissions")],
30+
),
31+
html.text("."),
32+
html.br([]),
33+
html.text("If you have more questions, you can "),
34+
html.a(
35+
[attribute.href("/contact/"), attribute.class("underline font-bold")],
36+
[html.text("contact me")],
37+
),
38+
html.text("."),
5839
])
5940
}

0 commit comments

Comments
 (0)