tangled
alpha
login
or
join now
kacaii.dev
/
blog
0
fork
atom
💻 My personal website
blog.kacaii.dev/
blog
gleam
lustre
0
fork
atom
overview
issues
pulls
pipelines
:recycle: filter posts that start with `/`
kacaii.dev
2 months ago
8201931d
b32c2195
+8
-3
3 changed files
expand all
collapse all
unified
split
src
blog
page
content.gleam
posts.gleam
recent_posts.gleam
+1
-1
src/blog/page/content.gleam
···
19
19
let title = post.meta.title
20
20
21
21
let post_header =
22
22
-
html.header([class("hidden sm:block")], [
22
22
+
html.header([class("hidden md:block")], [
23
23
html.h1([class("mb-1 text-4xl font-bold")], [html.text(title)]),
24
24
html.p([class("my-2")], [html.text(post.meta.description)]),
25
25
html.hr([class("border text-ctp-overlay0")]),
+4
-1
src/blog/page/posts.gleam
···
14
14
15
15
pub fn handle_request(ctx: web.Context) -> wisp.Response {
16
16
let ul_styles = class("grid grid-cols-1 gap-4 mx-auto w-full")
17
17
-
let posts = list.filter(ctx.posts, fn(post) { post.meta.title != "/uses" })
17
17
+
let posts =
18
18
+
list.filter(ctx.posts, fn(post) {
19
19
+
!string.starts_with(post.meta.title, "/")
20
20
+
})
18
21
19
22
let content = [
20
23
navbar.view([]),
+3
-1
src/blog/page/recent_posts.gleam
···
8
8
9
9
pub fn view(recent_posts: List(post.Post)) {
10
10
let previews =
11
11
-
list.filter(recent_posts, fn(post) { post.meta.title != "/uses" })
11
11
+
list.filter(recent_posts, fn(post) {
12
12
+
!string.starts_with(post.meta.title, "/")
13
13
+
})
12
14
|> list.take(2)
13
15
|> list.map(post_to_li)
14
16