My personal website, in gleam+lustre!
0
fork

Configure Feed

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

Fix doubled alias and add check


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

+24 -1
+24 -1
src/homepage.gleam
··· 272 272 ".creative", 273 273 ".creative-art", 274 274 ], 275 - aliases: ["mousemouse-3-2-textured"], 275 + aliases: ["mousemouse-3-2"], 276 276 comments: CommentsDisable, 277 277 category: "Art", 278 278 ), ··· 1069 1069 category:, 1070 1070 tags:, 1071 1071 ) = takes 1072 + // Validity checks 1072 1073 list.each(aliases, fn(alias) { 1073 1074 let message = 1074 1075 "Alias '" ··· 1085 1086 False -> Nil 1086 1087 } 1087 1088 }) 1089 + let other_posts = posts() |> list.filter(fn(post) { post != takes }) 1090 + list.each(other_posts, fn(post) { 1091 + let message = "ID for post " <> int.to_string(id) <> " is doubled." 1092 + case post.id == takes.id { 1093 + True -> panic as message 1094 + False -> Nil 1095 + } 1096 + list.each(aliases, fn(alias) { 1097 + let message = 1098 + "Alias '" 1099 + <> alias 1100 + <> "' for post " 1101 + <> int.to_string(id) 1102 + <> " is doubled in " 1103 + <> int.to_string(post.id) 1104 + case list.contains(post.aliases, alias) { 1105 + True -> panic as message 1106 + False -> Nil 1107 + } 1108 + }) 1109 + }) 1110 + // Normalisation 1088 1111 let category = category |> string.replace(" ", "_") 1089 1112 let tags = list.map(tags, fn(tag) { string.replace(tag, " ", "_") }) 1090 1113 NormalizedPost(