My website lesbian.skin

site: Render djot in post/project descriptions

Signed-off-by: Naomi Roberts <mia@naomieow.xyz>

lesbian.skin 08b4b777 997f8627

verified
+57 -67
+1
flake.nix
··· 18 18 gleam 19 19 erlang_28 20 20 beam28Packages.rebar3 21 + bun 21 22 ]; 22 23 }; 23 24 });
+10 -10
manifest.toml
··· 3 3 4 4 packages = [ 5 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" }, 6 + { name = "exception", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "exception", source = "hex", outer_checksum = "329D269D5C2A314F7364BD2711372B6F2C58FA6F39981572E5CA68624D291F8C" }, 7 7 { name = "filepath", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "B06A9AF0BF10E51401D64B98E4B627F1D2E48C154967DA7AF4D0914780A6D40A" }, 8 - { name = "gleam_crypto", version = "1.5.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_crypto", source = "hex", outer_checksum = "917BC8B87DBD584830E3B389CBCAB140FFE7CB27866D27C6D0FB87A9ECF35602" }, 9 - { name = "gleam_erlang", version = "0.34.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "0C38F2A128BAA0CEF17C3000BD2097EB80634E239CE31A86400C4416A5D0FDCC" }, 10 - { name = "gleam_json", version = "3.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "5BA154440B22D9800955B1AB854282FA37B97F30F409D76B0824D0A60C934188" }, 11 - { name = "gleam_otp", version = "0.16.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "50DA1539FC8E8FA09924EB36A67A2BBB0AD6B27BCDED5A7EF627057CF69D035E" }, 8 + { name = "gleam_crypto", version = "1.5.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_crypto", source = "hex", outer_checksum = "50774BAFFF1144E7872814C566C5D653D83A3EBF23ACC3156B757A1B6819086E" }, 9 + { name = "gleam_erlang", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "1124AD3AA21143E5AF0FC5CF3D9529F6DB8CA03E43A55711B60B6B7B3874375C" }, 10 + { name = "gleam_json", version = "3.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "874FA3C3BB6E22DD2BB111966BD40B3759E9094E05257899A7C08F5DE77EC049" }, 11 + { name = "gleam_otp", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "7987CBEBC8060B88F14575DEF546253F3116EBE2A5DA6FD82F38243FCE97C54B" }, 12 12 { name = "gleam_regexp", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_regexp", source = "hex", outer_checksum = "9C215C6CA84A5B35BB934A9B61A9A306EC743153BE2B0425A0D032E477B062A9" }, 13 - { name = "gleam_stdlib", version = "0.60.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "621D600BB134BC239CB2537630899817B1A42E60A1D46C5E9F3FAE39F88C800B" }, 14 - { name = "gleeunit", version = "1.3.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "A7DD6C07B7DA49A6E28796058AA89E651D233B357D5607006D70619CD89DAAAB" }, 15 - { name = "houdini", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "houdini", source = "hex", outer_checksum = "5BA517E5179F132F0471CB314F27FE210A10407387DA1EA4F6FD084F74469FC2" }, 13 + { name = "gleam_stdlib", version = "0.62.1", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "0080706D3A5A9A36C40C68481D1D231D243AF602E6D2A2BE67BA8F8F4DFF45EC" }, 14 + { name = "gleeunit", version = "1.6.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "FDC68A8C492B1E9B429249062CD9BAC9B5538C6FBF584817205D0998C42E1DAC" }, 15 + { name = "houdini", version = "1.2.0", build_tools = ["gleam"], requirements = [], otp_app = "houdini", source = "hex", outer_checksum = "5DB1053F1AF828049C2B206D4403C18970ABEF5C18671CA3C2D2ED0DD64F6385" }, 16 16 { name = "jot", version = "4.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "houdini", "splitter"], otp_app = "jot", source = "hex", outer_checksum = "E9E266D2768EA1238283D2CF125AA68095F17BAA4DDF3598360FD19F38593C59" }, 17 - { 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" }, 17 + { 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" }, 18 18 { 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" }, 19 - { name = "simplifile", version = "2.2.1", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "C88E0EE2D509F6D86EB55161D631657675AA7684DAB83822F7E59EB93D9A60E3" }, 19 + { name = "simplifile", version = "2.3.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0A868DAC6063D9E983477981839810DC2E553285AB4588B87E3E9C96A7FB4CB4" }, 20 20 { name = "splitter", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "splitter", source = "hex", outer_checksum = "128FC521EE33B0012E3E64D5B55168586BC1B9C8D7B0D0CA223B68B0D770A547" }, 21 21 { 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" }, 22 22 { name = "tom", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "tom", source = "hex", outer_checksum = "0910EE688A713994515ACAF1F486A4F05752E585B9E3209D8F35A85B234C2719" },
-3
src/website/common.gleam
··· 3 3 import lustre/attribute as attr 4 4 import lustre/element 5 5 import lustre/element/html 6 - import lustre/ssg/djot 7 6 import tom 8 - 9 - // import website/djot_renderer 10 7 import website/style 11 8 12 9 pub type Post(a) {
+45 -53
src/website/page/index.gleam
··· 2 2 import lustre/attribute as attr 3 3 import lustre/element.{type Element} 4 4 import lustre/element/html 5 + import lustre/ssg/djot 5 6 import website/common 6 7 import website/data/posts 8 + import website/djot_renderer 7 9 import website/style 8 10 9 11 pub fn view( ··· 11 13 projects projects: List(common.Project(a)), 12 14 ) -> List(Element(a)) { 13 15 let post_count = list.length(posts) 14 - let project_count = list.length(projects) 16 + let _project_count = list.length(projects) 15 17 [ 16 18 style.index_layout_query(), 17 19 html.div([attr.class("index-layout"), style.index_layout()], [ ··· 74 76 |> list.drop(post_count - 2) 75 77 |> list.reverse() 76 78 |> list.map(fn(post) { 77 - html.a( 78 - [ 79 - style.post_card(), 80 - attr.style("max-width", "44%"), 81 - attr.href("/posts/" <> post.id), 82 - ], 83 - [ 84 - html.span( 85 - [ 86 - attr.styles([ 87 - #("display", "flex"), 88 - #("justify-content", "space-between"), 89 - ]), 90 - ], 91 - [ 92 - html.h4([attr.styles([#("margin", "0px")])], [ 93 - html.text(post.title), 94 - ]), 95 - html.h4([attr.styles([#("margin", "0px")])], [ 96 - html.text(post.date_posted |> common.date_to_string()), 97 - ]), 98 - ], 99 - ), 100 - html.text(post.summary), 101 - ], 102 - ) 79 + html.div([style.post_card(), attr.style("max-width", "44%")], [ 80 + html.a( 81 + [ 82 + attr.styles([ 83 + #("display", "flex"), 84 + #("justify-content", "space-between"), 85 + ]), 86 + style.link(), 87 + attr.href("/posts/" <> post.id), 88 + ], 89 + [ 90 + html.h4([attr.styles([#("margin", "0px")])], [ 91 + html.text(post.title), 92 + ]), 93 + html.h4([attr.styles([#("margin", "0px")])], [ 94 + html.text(post.date_posted |> common.date_to_string()), 95 + ]), 96 + ], 97 + ), 98 + ..djot.render(post.summary, djot_renderer.renderer()) 99 + ]) 103 100 }), 104 101 ), 105 102 ]), ··· 119 116 projects 120 117 |> list.sample(2) 121 118 |> list.map(fn(project) { 122 - html.a( 123 - [ 124 - style.post_card(), 125 - attr.style("max-width", "44%"), 126 - attr.href("/projects/" <> project.id), 127 - ], 128 - [ 129 - html.span( 130 - [ 131 - attr.styles([ 132 - #("display", "flex"), 133 - #("justify-content", "space-between"), 134 - ]), 135 - ], 136 - [ 137 - html.h4([attr.styles([#("margin", "0px")])], [ 138 - html.text(project.title), 139 - ]), 140 - html.h4([attr.styles([#("margin", "0px")])], [ 141 - html.text(project.author), 142 - ]), 143 - ], 144 - ), 145 - html.text(project.summary), 146 - ], 147 - ) 119 + html.div([style.post_card(), attr.style("max-width", "44%")], [ 120 + html.a( 121 + [ 122 + attr.styles([ 123 + #("display", "flex"), 124 + #("justify-content", "space-between"), 125 + ]), 126 + style.link(), 127 + attr.href("/projects/" <> project.id), 128 + ], 129 + [ 130 + html.h4([attr.styles([#("margin", "0px")])], [ 131 + html.text(project.title), 132 + ]), 133 + html.h4([attr.styles([#("margin", "0px")])], [ 134 + html.text(project.author), 135 + ]), 136 + ], 137 + ), 138 + ..djot.render(project.summary, djot_renderer.renderer()) 139 + ]) 148 140 }), 149 141 ), 150 142 ]),
+1 -1
src/website/page/project.gleam
··· 3 3 import lustre/element.{type Element} 4 4 import lustre/element/html 5 5 import lustre/ssg/djot 6 - import website/common.{type Project, Project} 6 + import website/common.{type Project} 7 7 import website/data/projects 8 8 import website/djot_renderer 9 9 import website/style