My personal website, in gleam+lustre!
0
fork

Configure Feed

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

Moved: Amigo & Ferry say Hi

+93 -13
+72 -13
src/homepage.gleam
··· 1 - import gleam/function 2 - import gleam/string 3 - 4 1 // Post data 5 2 6 3 fn posts() { 7 4 [ 8 5 Post( 6 + id: 1, 7 + title: "Amigo & Ferry say hi!", 8 + summary: "Introducing Amigo The Slug and Ferry the cactus - characters created for the Blub discord server that became fan favorites!", 9 + published: Date(2023, April, 10), 10 + revised: None, 11 + body: File( 12 + Djot, 13 + "./written-contents/blog/creative/drawings/amigo and ferry/amigo-ferry-hi.dj", 14 + ), 15 + aliases: ["amigo-ferry-hi"], 16 + comments: MastodonStatusLink("pony.social", "116215266041721642"), 17 + category: "Art", 18 + tags: [ 19 + "Amigo & Ferry", 20 + "Art", 21 + "Character Design", 22 + "Original Characters", 23 + "OC", 24 + "Slug", 25 + "Cactus", 26 + "Discord", 27 + "Blub", 28 + "Pico", 29 + "Creative", 30 + "Friendship", 31 + "OCid:AF", 32 + ".creative-art", 33 + ], 34 + ), 35 + Post( 9 36 id: 0, 10 37 title: "New site, who dis?", 11 38 summary: "I rewrote this site from scratch!", 12 - published: "2026-03-11", 39 + published: Date(2026, March, 11), 13 40 revised: None, 14 41 body: File(Djot, "./written-contents/blog/personal/2026/new-site.dj"), 15 42 aliases: ["first"], ··· 202 229 import chilp 203 230 import chilp/widget 204 231 import gleam/dict.{type Dict} 232 + import gleam/function 205 233 import gleam/int 206 234 import gleam/list 207 235 import gleam/option.{type Option, None, Some} 208 236 import gleam/pair 209 237 import gleam/result 238 + import gleam/string 239 + import gleam/time/calendar.{ 240 + April, August, Date, December, February, January, July, June, March, May, 241 + November, October, September, 242 + } 210 243 import gleam/uri.{type Uri} 211 244 import homepage/djotparse 212 245 import homepage/from_prebuild/data ··· 252 285 category: String, 253 286 title: String, 254 287 summary: String, 255 - published: String, 256 - revised: Option(String), 288 + published: calendar.Date, 289 + revised: Option(calendar.Date), 257 290 body: Body, 258 291 tags: List(String), 259 292 aliases: List(String), ··· 272 305 id: Int, 273 306 category: String, 274 307 title: String, 275 - published: String, 276 - revised: Option(String), 308 + published: calendar.Date, 309 + revised: Option(calendar.Date), 277 310 summary: String, 278 311 body: Element(Msg), 279 312 tags: List(String), ··· 1483 1516 } 1484 1517 }) 1485 1518 |> dict.values 1486 - |> list.sort(fn(a, b) { int.compare(a.id, b.id) }) 1519 + |> list.sort(fn(a, b) { 1520 + calendar.naive_date_compare(b.published, a.published) 1521 + }) 1487 1522 let posts = case postlist { 1488 1523 [] -> [ 1489 1524 html.p([attribute.class("mt-6")], [ ··· 1610 1645 "Category: " 1611 1646 <> post.category |> string.replace("_", " ") 1612 1647 <> " • Posted: " 1613 - <> post.published 1648 + <> date_to_yyyy_mm_dd(post.published) 1614 1649 <> case post.revised { 1615 - Some(updated) -> " • Updated: " <> updated 1650 + Some(updated) -> " • Updated: " <> date_to_yyyy_mm_dd(updated) 1616 1651 None -> "" 1617 1652 }, 1618 1653 ), ··· 1646 1681 ), 1647 1682 html.text( 1648 1683 " • Posted: " 1649 - <> post.published 1684 + <> date_to_yyyy_mm_dd(post.published) 1650 1685 <> case post.revised { 1651 - Some(updated) -> " • Updated: " <> updated 1686 + Some(updated) -> " • Updated: " <> date_to_yyyy_mm_dd(updated) 1652 1687 None -> "" 1653 1688 }, 1654 1689 ), ··· 1866 1901 Well that was somewhat expected.", 1867 1902 ), 1868 1903 ] 1904 + } 1905 + 1906 + fn date_to_yyyy_mm_dd(date: calendar.Date) -> String { 1907 + let Date(year, month, day) = date 1908 + int.to_string(year) 1909 + <> "-" 1910 + <> { 1911 + case month { 1912 + December -> "12" 1913 + November -> "11" 1914 + October -> "10" 1915 + September -> "09" 1916 + August -> "08" 1917 + July -> "07" 1918 + June -> "06" 1919 + May -> "05" 1920 + April -> "04" 1921 + March -> "03" 1922 + February -> "02" 1923 + January -> "01" 1924 + } 1925 + } 1926 + <> "-" 1927 + <> int.to_string(day) 1869 1928 } 1870 1929 1871 1930 // Reusable non-component components ========================================================================
+21
written-contents/blog/creative/drawings/amigo and ferry/amigo-ferry-hi.dj
··· 1 + # Amigo & Ferry say hi! 2 + 3 + _This post was migrated from an older version of strawmelonjuice.com. It 4 + might have some quirks._ 5 + 6 + > More Amigo & Ferry posts: [`#OCid:AF`](#!/tag/OCid:AF) 7 + 8 + ![Amigo & Ferry](/img/art/AF/hi.png) 9 + 10 + > Created to be Pico's friends for the Blub discord server, these 11 + > characters pretty soon became their own story (and from fans, got even 12 + > more love than Pico!) 13 + 14 + Amigo The Slug is a bit socially awkward, but luckily he wears his best 15 + friend on his head, in between the eyes! Ferry the cactus is a shy guy, 16 + but he loves to look cool. The two wouldn't know what to do without one 17 + another. 18 + 19 + {.notion} 20 + This art is mine, you may not download and use this without [asking 21 + me](mailto:mar@strawmelonjuice.com) and getting my permission!