My personal website, in gleam+lustre!
0
fork

Configure Feed

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

Archived a post

+21 -3
+21 -3
src/homepage.gleam
··· 1 - import gleam/time/timestamp 1 + const highlighted_posts = [] 2 2 3 3 /// Post data ------------------------------------------------------------------- 4 4 /// ··· 188 188 "./written-contents/blog/personal/2025/denouncing-github.dj", 189 189 ), 190 190 tags: [ 191 + ".archived", 191 192 "github", 192 193 "git", 193 194 "GitHub", ··· 446 447 ), 447 448 ] 448 449 } 449 - 450 - const highlighted_posts = [900] 451 450 452 451 const pages = [ 453 452 Entry( ··· 758 757 April, August, Date, December, February, January, July, June, March, May, 759 758 November, October, September, 760 759 } 760 + import gleam/time/timestamp 761 761 import gleam/uri.{type Uri} 762 762 import homepage/djotparse 763 763 import homepage/from_prebuild/data ··· 795 795 pub fn posts_entries(posts: List(Post)) -> List(FeedEntry) { 796 796 posts 797 797 |> list.map(fn(post) { 798 + use <- bool.guard(post.tags |> list.contains(".archived"), Error(Nil)) 798 799 FeedEntry( 799 800 post.id, 800 801 post.summary, ··· 817 818 None -> post.published 818 819 }, 819 820 ) 821 + |> Ok 820 822 }) 823 + |> result.values 821 824 } 822 825 823 826 fn render_badge(badge: Badge) -> Element(Msg) { ··· 2102 2105 _ -> 2103 2106 postlist 2104 2107 |> list.filter(fn(item) { !list.contains(item.tags, ".unlisted") }) 2108 + |> list.filter(fn(item) { 2109 + case filtered { 2110 + PostsWithTag(".archived") -> True 2111 + _ -> !list.contains(item.tags, ".archived") 2112 + } 2113 + }) 2105 2114 |> list.map(view_post_preview) 2106 2115 } 2107 2116 [ ··· 2228 2237 PostsWithTag(".creative-writings") -> { 2229 2238 [ 2230 2239 title("Stories"), 2240 + html.p([], [ 2241 + link(Posts, "<- See all posts instead"), 2242 + ]), 2243 + ] 2244 + |> element.fragment 2245 + } 2246 + PostsWithTag(".archived") -> { 2247 + [ 2248 + title("Archived posts"), 2231 2249 html.p([], [ 2232 2250 link(Posts, "<- See all posts instead"), 2233 2251 ]),