My personal website, in gleam+lustre!
0
fork

Configure Feed

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

Fix all subposts suddenly having their parent post id as anchor.


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

+18 -9
+18 -9
src/homepage.gleam
··· 1140 1140 fn post_body_normalize(takes: Post) -> Element(Msg) { 1141 1141 case takes.body { 1142 1142 LiveBlog(items) -> { 1143 - let wrap = fn(label: String, content: List(Element(Msg)), date: String) -> Element( 1144 - Msg, 1145 - ) { 1143 + let wrap = fn( 1144 + label: String, 1145 + content: List(Element(Msg)), 1146 + subitem_id: Int, 1147 + date: String, 1148 + ) -> Element(Msg) { 1146 1149 [ 1147 1150 html.a( 1148 1151 [ 1149 - attribute.class("text-sm float-right"), 1150 - attribute.id(int.to_string(takes.id)), 1151 - attribute.href("#" <> int.to_string(takes.id)), 1152 + attribute.id(int.to_string(subitem_id)), 1153 + attribute.href("#" <> int.to_string(subitem_id)), 1152 1154 ], 1153 1155 [ 1154 - element.text(date), 1156 + html.span( 1157 + [ 1158 + attribute.class("text-sm float-right"), 1159 + ], 1160 + [ 1161 + element.text(date), 1162 + ], 1163 + ), 1164 + subtitle(label), 1155 1165 ], 1156 1166 ), 1157 - subtitle(label), 1158 1167 html.div( 1159 1168 [ 1160 1169 attribute.class( ··· 1178 1187 ) 1179 1188 }) 1180 1189 |> result.unwrap(#("", [element.text("Could not load this update.")])) 1181 - wrap(title, sub_item.1, sub_item.0) 1190 + wrap(title, sub_item.1, id, sub_item.0) 1182 1191 }) 1183 1192 |> element.fragment() 1184 1193 }