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
:truck: rename `post.to_html` to `post.view()`
kacaii.dev
2 months ago
6df073b2
b4dd99a1
+6
-7
3 changed files
expand all
collapse all
unified
split
Dockerfile
src
blog
page
content.gleam
post.gleam
+3
Dockerfile
···
26
26
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 CMD [ "/blog/healthcheck.sh" ]
27
27
28
28
WORKDIR /blog
29
29
+
30
30
+
EXPOSE 8080
31
31
+
29
32
ENTRYPOINT ["/blog/entrypoint.sh"]
30
33
CMD ["run"]
+1
-5
src/blog/page/content.gleam
···
14
14
}
15
15
16
16
fn view(found_post) -> wisp.Response {
17
17
-
let content = [
18
18
-
navbar.view(),
19
19
-
post.to_html(found_post),
20
20
-
footer.view(),
21
21
-
]
17
17
+
let content = [navbar.view(), post.view(found_post), footer.view()]
22
18
root.view(content:)
23
19
}
+2
-2
src/blog/post.gleam
···
49
49
}
50
50
}
51
51
52
52
-
pub fn to_html(post: Post) -> element.Element(a) {
52
52
+
pub fn view(post: Post) -> element.Element(a) {
53
53
let content =
54
54
post.body.content
55
55
|> list.map(highlight_gleam_codeblock)
···
61
61
let style =
62
62
class("grid grid-cols-1 gap-4 mx-auto max-w-md text-pretty post-content")
63
63
64
64
-
let html = element.unsafe_raw_html("", "main", [style], post_body)
64
64
+
let html = element.unsafe_raw_html("", "article", [style], post_body)
65
65
66
66
element.fragment([html])
67
67
}