My personal website, in gleam+lustre!
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Got started on a lil post :3


Signed-off-by: MLC Bloeiman <mar@strawmelonjuice.com>

+47 -30
+1 -23
README.md
··· 1 1 # homepage 2 2 3 - [![Package Version](https://img.shields.io/hexpm/v/homepage)](https://hex.pm/packages/homepage) 4 - [![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/homepage/) 5 - 6 - ```sh 7 - gleam add homepage@1 8 - ``` 9 - 10 - ```gleam 11 - import homepage 12 - 13 - pub fn main() -> Nil { 14 - // TODO: An example of the project in use 15 - } 16 - ``` 17 - 18 - Further documentation can be found at <https://hexdocs.pm/homepage>. 19 - 20 - ## Development 21 - 22 - ```sh 23 - gleam run # Run the project 24 - gleam test # Run the tests 25 - ``` 3 + My personal site. Currently live at <https://strawmelonjuice.com> and <https://site.strawmelonjuice.com>.
+42 -4
src/homepage.gleam
··· 19 19 pub fn posts() { 20 20 [ 21 21 Post( 22 + id: 4, 23 + category: "Personal", 24 + title: "What I use: 2026 edition", 25 + summary: "And what changed recently, as I've never done these before.", 26 + published: Date(2026, April, 18) 27 + |> stuff.date_stamp(hours: 15, minutes: 30), 28 + revised: None, 29 + body: File(Djot, "./written-contents/blog/what-i-use-26.dj"), 30 + tags: [ 31 + "coding", 32 + "software engineering", 33 + "technology", 34 + "personal blog", 35 + "tech", 36 + "music", 37 + "personal favourites", 38 + "pokemon naming", 39 + ".blog-personal", 40 + "linux", 41 + ], 42 + aliases: [], 43 + comments: CommentsDisable, 44 + ), 45 + Post( 22 46 3, 23 47 category: "Devlog", 24 48 title: "I lied", ··· 81 105 body: File(Djot, "./written-contents/blog/personal/2026/new-site.dj"), 82 106 aliases: ["first"], 83 107 comments: MastodonStatusLink("pony.social", "116213072855558563"), 84 - category: "Meta", 108 + category: "Personal", 85 109 tags: [ 86 110 "gleam", 87 111 "lustre", ··· 155 179 ), 156 180 Post( 157 181 id: 897, 158 - category: "Meta", 182 + category: "Personal", 159 183 title: "strawmelonjuice logo revamp 2026!", 160 184 summary: "New logo design for strawmelonjuice in 2026! OMG!", 161 185 published: Date(2026, January, 10) |> stuff.no_time_timestamp, ··· 211 235 ), 212 236 Post( 213 237 id: 895, 214 - category: "brainfart as art", 238 + category: "Art", 215 239 title: "A misunderstanding", 216 240 summary: "Just trying things out lol", 217 241 published: Date(2023, July, 14) |> stuff.no_time_timestamp, ··· 446 470 ), 447 471 ), 448 472 ] 473 + // Hiding drafts! 474 + |> list.filter(fn(post) { 475 + case post.published |> timestamp.compare(timestamp.system_time()) { 476 + order.Gt -> { 477 + case modem.initial_uri() { 478 + Ok(s) if s.host == Some("localhost") -> True 479 + _ -> False 480 + } 481 + } 482 + order.Eq -> True 483 + order.Lt -> True 484 + } 485 + }) 449 486 } 450 487 451 488 const pages = [ ··· 749 786 import gleam/io 750 787 import gleam/list 751 788 import gleam/option.{type Option, None, Some} 789 + import gleam/order 752 790 import gleam/pair 753 791 import gleam/result 754 792 import gleam/string ··· 1495 1533 ]), 1496 1534 html.p([], [ 1497 1535 html.text( 1498 - " This code is licensed under MIT License, content is mine, but can be freely shared with attribution in the form of a link to the original website. AI's and LLM's are not allowed to use any content, code or data from this website or it's repository.", 1536 + " This code is licensed under MIT License, content is mine (source-available/most rights preserved), but can be freely shared with attribution in the form of a link to the original website. AI's and LLM's are not allowed to use any content, code or data from this website or it's repository.", 1499 1537 ), 1500 1538 ]), 1501 1539 ]),
+3 -3
src/homepage/djotparse.gleam
··· 65 65 |> jot.to_html 66 66 |> string.replace("<p>", p) 67 67 |> string.replace("<li", "<li class=\"mt-2\"") 68 - |> regexp.replace(regex_h4, _, h4.0) 68 + |> regexp.replace(regex_h4, _, h4.0 <> ">") 69 69 |> string.replace("</h4>", h4.1) 70 - |> regexp.replace(regex_h3, _, h3.0) 70 + |> regexp.replace(regex_h3, _, h3.0 <> ">") 71 71 |> string.replace("</h3>", h3.1) 72 72 |> regexp.replace(regex_h2, _, h2.0 <> ">") 73 73 |> string.replace("</h2>", h2.1) 74 - |> regexp.replace(regex_h1, _, h1.0) 74 + |> regexp.replace(regex_h1, _, h1.0 <> ">") 75 75 |> string.replace("</h1>", h1.1) 76 76 |> string.replace("<a ", a) 77 77 |> string.replace("<strong", "<strong class=\"font-bold\"")
+1
written-contents/blog/what-i-use-26.dj
··· 1 + I felt like it was time for me to do this too sometime!