diff --git a/flake.nix b/flake.nix index b450840..4d0739c 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,7 @@ gleam erlang_28 beam28Packages.rebar3 + bun ]; }; }); diff --git a/manifest.toml b/manifest.toml index d4612a4..d5d6e55 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,20 +3,20 @@ packages = [ { name = "envoy", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "envoy", source = "hex", outer_checksum = "95FD059345AA982E89A0B6E2A3BF1CF43E17A7048DCD85B5B65D3B9E4E39D359" }, - { name = "exception", version = "2.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "exception", source = "hex", outer_checksum = "F5580D584F16A20B7FCDCABF9E9BE9A2C1F6AC4F9176FA6DD0B63E3B20D450AA" }, + { name = "exception", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "exception", source = "hex", outer_checksum = "329D269D5C2A314F7364BD2711372B6F2C58FA6F39981572E5CA68624D291F8C" }, { name = "filepath", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "B06A9AF0BF10E51401D64B98E4B627F1D2E48C154967DA7AF4D0914780A6D40A" }, - { name = "gleam_crypto", version = "1.5.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_crypto", source = "hex", outer_checksum = "917BC8B87DBD584830E3B389CBCAB140FFE7CB27866D27C6D0FB87A9ECF35602" }, - { name = "gleam_erlang", version = "0.34.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "0C38F2A128BAA0CEF17C3000BD2097EB80634E239CE31A86400C4416A5D0FDCC" }, - { name = "gleam_json", version = "3.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "5BA154440B22D9800955B1AB854282FA37B97F30F409D76B0824D0A60C934188" }, - { name = "gleam_otp", version = "0.16.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "50DA1539FC8E8FA09924EB36A67A2BBB0AD6B27BCDED5A7EF627057CF69D035E" }, + { name = "gleam_crypto", version = "1.5.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_crypto", source = "hex", outer_checksum = "50774BAFFF1144E7872814C566C5D653D83A3EBF23ACC3156B757A1B6819086E" }, + { name = "gleam_erlang", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "1124AD3AA21143E5AF0FC5CF3D9529F6DB8CA03E43A55711B60B6B7B3874375C" }, + { name = "gleam_json", version = "3.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "874FA3C3BB6E22DD2BB111966BD40B3759E9094E05257899A7C08F5DE77EC049" }, + { name = "gleam_otp", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "7987CBEBC8060B88F14575DEF546253F3116EBE2A5DA6FD82F38243FCE97C54B" }, { name = "gleam_regexp", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_regexp", source = "hex", outer_checksum = "9C215C6CA84A5B35BB934A9B61A9A306EC743153BE2B0425A0D032E477B062A9" }, - { name = "gleam_stdlib", version = "0.60.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "621D600BB134BC239CB2537630899817B1A42E60A1D46C5E9F3FAE39F88C800B" }, - { name = "gleeunit", version = "1.3.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "A7DD6C07B7DA49A6E28796058AA89E651D233B357D5607006D70619CD89DAAAB" }, - { name = "houdini", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "houdini", source = "hex", outer_checksum = "5BA517E5179F132F0471CB314F27FE210A10407387DA1EA4F6FD084F74469FC2" }, + { name = "gleam_stdlib", version = "0.62.1", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "0080706D3A5A9A36C40C68481D1D231D243AF602E6D2A2BE67BA8F8F4DFF45EC" }, + { name = "gleeunit", version = "1.6.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "FDC68A8C492B1E9B429249062CD9BAC9B5538C6FBF584817205D0998C42E1DAC" }, + { name = "houdini", version = "1.2.0", build_tools = ["gleam"], requirements = [], otp_app = "houdini", source = "hex", outer_checksum = "5DB1053F1AF828049C2B206D4403C18970ABEF5C18671CA3C2D2ED0DD64F6385" }, { name = "jot", version = "4.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "houdini", "splitter"], otp_app = "jot", source = "hex", outer_checksum = "E9E266D2768EA1238283D2CF125AA68095F17BAA4DDF3598360FD19F38593C59" }, - { name = "lustre", version = "5.1.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib", "houdini"], otp_app = "lustre", source = "hex", outer_checksum = "A0ADD4D936A49EE2CEBB8070F39058009122F0321D4B5445843D56E54875ECD8" }, + { name = "lustre", version = "5.3.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib", "houdini"], otp_app = "lustre", source = "hex", outer_checksum = "58CEFEC305CDC3B7DA4A2E56B1AF8D79E97784F982A5592E7BFB0E1A8E4B8156" }, { name = "lustre_ssg", version = "0.11.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_regexp", "gleam_stdlib", "jot", "lustre", "simplifile", "temporary", "tom"], otp_app = "lustre_ssg", source = "hex", outer_checksum = "D1F2B47EBE27C2B1DE6552A0883BC676D8EB076359D152FFA323FADDC74FFC41" }, - { name = "simplifile", version = "2.2.1", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "C88E0EE2D509F6D86EB55161D631657675AA7684DAB83822F7E59EB93D9A60E3" }, + { name = "simplifile", version = "2.3.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0A868DAC6063D9E983477981839810DC2E553285AB4588B87E3E9C96A7FB4CB4" }, { name = "splitter", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "splitter", source = "hex", outer_checksum = "128FC521EE33B0012E3E64D5B55168586BC1B9C8D7B0D0CA223B68B0D770A547" }, { 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" }, { name = "tom", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "tom", source = "hex", outer_checksum = "0910EE688A713994515ACAF1F486A4F05752E585B9E3209D8F35A85B234C2719" }, diff --git a/src/website/common.gleam b/src/website/common.gleam index efe4bf9..224b1cc 100644 --- a/src/website/common.gleam +++ b/src/website/common.gleam @@ -3,10 +3,7 @@ import gleam/option.{type Option} import lustre/attribute as attr import lustre/element import lustre/element/html -import lustre/ssg/djot import tom - -// import website/djot_renderer import website/style pub type Post(a) { diff --git a/src/website/page/index.gleam b/src/website/page/index.gleam index 6378802..6b1631f 100644 --- a/src/website/page/index.gleam +++ b/src/website/page/index.gleam @@ -2,8 +2,10 @@ import gleam/list import lustre/attribute as attr import lustre/element.{type Element} import lustre/element/html +import lustre/ssg/djot import website/common import website/data/posts +import website/djot_renderer import website/style pub fn view( @@ -11,7 +13,7 @@ pub fn view( projects projects: List(common.Project(a)), ) -> List(Element(a)) { let post_count = list.length(posts) - let project_count = list.length(projects) + let _project_count = list.length(projects) [ style.index_layout_query(), html.div([attr.class("index-layout"), style.index_layout()], [ @@ -74,32 +76,27 @@ pub fn view( |> list.drop(post_count - 2) |> list.reverse() |> list.map(fn(post) { - html.a( - [ - style.post_card(), - attr.style("max-width", "44%"), - attr.href("/posts/" <> post.id), - ], - [ - html.span( - [ - attr.styles([ - #("display", "flex"), - #("justify-content", "space-between"), - ]), - ], - [ - html.h4([attr.styles([#("margin", "0px")])], [ - html.text(post.title), - ]), - html.h4([attr.styles([#("margin", "0px")])], [ - html.text(post.date_posted |> common.date_to_string()), - ]), - ], - ), - html.text(post.summary), - ], - ) + html.div([style.post_card(), attr.style("max-width", "44%")], [ + html.a( + [ + attr.styles([ + #("display", "flex"), + #("justify-content", "space-between"), + ]), + style.link(), + attr.href("/posts/" <> post.id), + ], + [ + html.h4([attr.styles([#("margin", "0px")])], [ + html.text(post.title), + ]), + html.h4([attr.styles([#("margin", "0px")])], [ + html.text(post.date_posted |> common.date_to_string()), + ]), + ], + ), + ..djot.render(post.summary, djot_renderer.renderer()) + ]) }), ), ]), @@ -119,32 +116,27 @@ pub fn view( projects |> list.sample(2) |> list.map(fn(project) { - html.a( - [ - style.post_card(), - attr.style("max-width", "44%"), - attr.href("/projects/" <> project.id), - ], - [ - html.span( - [ - attr.styles([ - #("display", "flex"), - #("justify-content", "space-between"), - ]), - ], - [ - html.h4([attr.styles([#("margin", "0px")])], [ - html.text(project.title), - ]), - html.h4([attr.styles([#("margin", "0px")])], [ - html.text(project.author), - ]), - ], - ), - html.text(project.summary), - ], - ) + html.div([style.post_card(), attr.style("max-width", "44%")], [ + html.a( + [ + attr.styles([ + #("display", "flex"), + #("justify-content", "space-between"), + ]), + style.link(), + attr.href("/projects/" <> project.id), + ], + [ + html.h4([attr.styles([#("margin", "0px")])], [ + html.text(project.title), + ]), + html.h4([attr.styles([#("margin", "0px")])], [ + html.text(project.author), + ]), + ], + ), + ..djot.render(project.summary, djot_renderer.renderer()) + ]) }), ), ]), diff --git a/src/website/page/project.gleam b/src/website/page/project.gleam index e2d4e0e..f4767b8 100644 --- a/src/website/page/project.gleam +++ b/src/website/page/project.gleam @@ -3,7 +3,7 @@ import lustre/attribute as attr import lustre/element.{type Element} import lustre/element/html import lustre/ssg/djot -import website/common.{type Project, Project} +import website/common.{type Project} import website/data/projects import website/djot_renderer import website/style