My personal website, in gleam+lustre!
0
fork

Configure Feed

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

Worked on the representation of tags

+55 -9
+49 -5
src/homepage.gleam
··· 41 41 tags: [ 42 42 "gleam", 43 43 "rust", 44 + "social media", 45 + "social media federation", 46 + "federation", 44 47 "website development", 45 48 "web development", 46 49 "programming", 47 50 "coding", 48 51 "software engineering", 49 52 "technology", 50 - "personal blog", 51 53 ".blog-personal", 52 54 ], 53 - aliases: ["lumina-blog"], 55 + aliases: ["lumina-blog", "Lumina"], 54 56 comments: CommentsDisable, 55 57 ), 56 58 Post( ··· 996 998 html.text("Click to show"), 997 999 ]), 998 1000 html.div([attribute.class("collapse-content")], [ 999 - rendered_children, 1001 + { 1002 + children 1003 + |> list.filter(fn(tag_entry) { 1004 + !string.starts_with(tag_entry.title, "#.") 1005 + }) 1006 + |> list.rest() 1007 + |> result.unwrap([]) 1008 + |> list.map(fn(tag_entry) { 1009 + [ 1010 + element.text(", "), 1011 + link(tag_entry.route, tag_entry.title), 1012 + ] 1013 + |> element.fragment 1014 + }) 1015 + |> list.append( 1016 + [ 1017 + { 1018 + let tag_entry = 1019 + children 1020 + |> list.filter(fn(tag_entry) { 1021 + !string.starts_with(tag_entry.title, "#.") 1022 + }) 1023 + |> list.first() 1024 + |> result.lazy_unwrap(fn() { 1025 + Entry( 1026 + route: NotFound("/tagged/"), 1027 + title: "no tags.", 1028 + last_updated: calendar.Date(2026, October, 08), 1029 + parent: NotFound("/tagged/"), 1030 + description: "", 1031 + ) 1032 + }) 1033 + link(tag_entry.route, tag_entry.title) 1034 + }, 1035 + ], 1036 + _, 1037 + ) 1038 + } 1039 + |> element.fragment(), 1000 1040 ]), 1001 1041 ], 1002 1042 ), ··· 1595 1635 ]), 1596 1636 links: [ 1597 1637 #("Tangled", "https://tangled.org/strawmelonjuice.com/Lumina/"), 1638 + #("Devlog", "https://strawmelonjuice.com/lumina-blog"), 1598 1639 ], 1599 1640 wip: True, 1600 1641 ), ··· 2213 2254 |> list.map(fn(tag) { 2214 2255 [ 2215 2256 element.text(", "), 2216 - link(Tagged(tag), tag |> string.replace("_", " ")), 2257 + link(Tagged(tag), "#" <> tag |> string.replace("_", " ")), 2217 2258 ] 2218 2259 |> element.fragment 2219 2260 }) ··· 2227 2268 }) 2228 2269 |> list.first() 2229 2270 |> result.unwrap("") 2230 - link(Tagged(tag), tag) 2271 + link( 2272 + Tagged(tag), 2273 + "#" <> tag |> string.replace("_", " "), 2274 + ) 2231 2275 }, 2232 2276 ], 2233 2277 _,
+6 -4
src/homepage/stuff.gleam
··· 152 152 case rest { 153 153 [] -> 154 154 list.sort(accumulated, fn(item_a, item_b) { 155 - calendar.naive_date_compare(item_a.last_updated, item_b.last_updated) 155 + calendar.naive_date_compare(item_b.last_updated, item_a.last_updated) 156 156 }) 157 157 [item, ..rest] -> { 158 158 // we filter out all the items that match route with this one, making sure we don't have to go over them again later. ··· 164 164 let newest = 165 165 [item, ..matching] 166 166 |> list.sort(fn(item_a, item_b) { 167 - calendar.naive_date_compare(item_a.last_updated, item_b.last_updated) 167 + calendar.naive_date_compare(item_b.last_updated, item_a.last_updated) 168 168 }) 169 169 |> list.first() 170 170 |> result.unwrap(item) ··· 224 224 AllAndEverything -> "/everything" 225 225 PersonalStartPage -> "/startpage" 226 226 NotFound(_) -> "/404" 227 - Tagged(v) -> "/posts/tagged/" <> uri.percent_encode(v) 228 - Category(c) -> "/posts/category/" <> uri.percent_encode(c) 227 + Tagged(v) -> 228 + "/posts/tagged/" <> uri.percent_encode(string.replace(v, " ", "_")) 229 + Category(c) -> 230 + "/posts/category/" <> uri.percent_encode(string.replace(c, " ", "_")) 229 231 Sitemap -> "/sitemap" 230 232 CuriculumVitae(False) -> "/cv/en" 231 233 CuriculumVitae(True) -> "/cv/nl"