Skip to content

Commit 4d3cae7

Browse files
Init lustre ssg
1 parent 27fff50 commit 4d3cae7

File tree

8 files changed

+55
-0
lines changed

8 files changed

+55
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.beam
22
*.ez
33
/build
4+
/priv
45
erl_crash.dump

gleam.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name = "website"
22
version = "1.0.0"
3+
target = "javascript"
34

45
# Fill out these fields if you intend to generate HTML documentation or publish
56
# your project to the Hex package manager.
@@ -14,6 +15,8 @@ version = "1.0.0"
1415

1516
[dependencies]
1617
gleam_stdlib = ">= 0.44.0 and < 2.0.0"
18+
lustre = ">= 4.6.3 and < 5.0.0"
1719

1820
[dev-dependencies]
1921
gleeunit = ">= 1.0.0 and < 2.0.0"
22+
lustre_ssg = ">= 0.8.3 and < 1.0.0"

manifest.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,25 @@
22
# You typically do not need to edit this file
33

44
packages = [
5+
{ name = "envoy", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "envoy", source = "hex", outer_checksum = "95FD059345AA982E89A0B6E2A3BF1CF43E17A7048DCD85B5B65D3B9E4E39D359" },
6+
{ name = "exception", version = "2.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "exception", source = "hex", outer_checksum = "F5580D584F16A20B7FCDCABF9E9BE9A2C1F6AC4F9176FA6DD0B63E3B20D450AA" },
7+
{ name = "filepath", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "67A6D15FB39EEB69DD31F8C145BB5A421790581BD6AA14B33D64D5A55DBD6587" },
8+
{ name = "gleam_crypto", version = "1.4.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_crypto", source = "hex", outer_checksum = "8AE56026B3E05EBB1F076778478A762E9EB62B31AEEB4285755452F397029D22" },
9+
{ name = "gleam_erlang", version = "0.33.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "A1D26B80F01901B59AABEE3475DD4C18D27D58FA5C897D922FCB9B099749C064" },
10+
{ name = "gleam_json", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "0A57FB5666E695FD2BEE74C0428A98B0FC11A395D2C7B4CDF5E22C5DD32C74C6" },
11+
{ name = "gleam_otp", version = "0.15.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "E9ED3DF7E7285DA0C440F46AE8236ADC8475E8CCBEE4899BF09A8468DA3F9187" },
512
{ name = "gleam_stdlib", version = "0.45.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "206FCE1A76974AECFC55AEBCD0217D59EDE4E408C016E2CFCCC8FF51278F186E" },
613
{ name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
14+
{ name = "jot", version = "1.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "jot", source = "hex", outer_checksum = "A0A52BD8D079AB0ABF80BE11DC63B85CF5791125991A029FAD7D17820D9419D8" },
15+
{ name = "lustre", version = "4.6.3", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "BDF833368F6C8F152F948D5B6A79866E9881CB80CB66C0685B3327E7DCBFB12F" },
16+
{ name = "lustre_ssg", version = "0.8.3", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib", "jot", "lustre", "simplifile", "temporary", "tom"], otp_app = "lustre_ssg", source = "hex", outer_checksum = "5F1DF752AE6AAD0BD332CCB52E1CF2086997CF55EB59894080F4E3ADF691B95C" },
17+
{ name = "simplifile", version = "2.2.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0DFABEF7DC7A9E2FF4BB27B108034E60C81BEBFCB7AB816B9E7E18ED4503ACD8" },
18+
{ name = "temporary", version = "1.0.0", build_tools = ["gleam"], requirements = ["envoy", "exception", "filepath", "gleam_crypto", "gleam_stdlib", "simplifile"], otp_app = "temporary", source = "hex", outer_checksum = "51C0FEF4D72CE7CA507BD188B21C1F00695B3D5B09D7DFE38240BFD3A8E1E9B3" },
19+
{ name = "tom", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "tom", source = "hex", outer_checksum = "228E667239504B57AD05EC3C332C930391592F6C974D0EFECF32FFD0F3629A27" },
720
]
821

922
[requirements]
1023
gleam_stdlib = { version = ">= 0.44.0 and < 2.0.0" }
1124
gleeunit = { version = ">= 1.0.0 and < 2.0.0" }
25+
lustre = { version = ">= 4.6.3 and < 5.0.0" }
26+
lustre_ssg = { version = ">= 0.8.3 and < 1.0.0" }

src/build.gleam

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import gleam/dict
2+
import gleam/io
3+
import gleam/list
4+
import lustre/ssg
5+
import website/data/projects
6+
import website/page/about
7+
import website/page/index
8+
import website/page/project
9+
10+
pub fn main() {
11+
// let posts =
12+
// dict.from_list({
13+
// use post <- list.map(posts.all())
14+
// #(post.id, post)
15+
// })
16+
17+
let build =
18+
ssg.new("./priv")
19+
|> ssg.add_static_route("/", index.view())
20+
// |> ssg.add_static_route("/blog", blog.view(posts.all()))
21+
// |> ssg.add_dynamic_route("/blog", posts, post.view)
22+
|> ssg.build
23+
24+
case build {
25+
Ok(_) -> io.println("Build succeeded!")
26+
Error(e) -> {
27+
io.debug(e)
28+
io.println("Build failed!")
29+
}
30+
}
31+
}

src/website/data/projects.gleam

Whitespace-only changes.

src/website/page/about.gleam

Whitespace-only changes.

src/website/page/index.gleam

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import lustre/element
2+
3+
pub fn view() {
4+
element.text("Hello!")
5+
}

src/website/page/project.gleam

Whitespace-only changes.

0 commit comments

Comments
 (0)