blob: d02baaccdce1012a4a89463e1c89fed237826a53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
open Wormhole
open Wormhole.Post
let render (posts: Post.t list) =
<html>
<script src="https://unpkg.com/htmx.org@1.9.9"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.12.0/cdn/themes/light.css"
/>
<script
type="module"
src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.12.0/cdn/shoelace-autoloader.js"
></script>
<head>
<title>Sensemaking Galaxy</title>
</head>
<body style="display:flex; flex-direction:column; align-items:center">
<h1>Sensemaking Galaxy</h1>
<div>
<sl-button variant="text" size="medium">rss</sl-button>
</div>
<p>Links that have ended up in this Galaxy were sent through space
and time by the Sensemaking Wormhole.</p>
% posts |> List.iter begin fun { author; link; summary; tags; _ } ->
<div>
<sl-card style="min-width: 400px; max-width: 600px; margin: 10px">
<div style="display:flex; flex-direction:column; gap: 10px">
<%s summary %>
<sl-button size="small" href=<%s link %>>Link (<%s Post.get_tld link %>)</sl-button>
</div>
<div slot="footer" style="display:flex; flex-direction:row; justify-content:space-between">
Submitted by: <%s author %>
<div style="display:flex; flex-direction:row; gap: 3px">
% tags |> List.iter begin fun tag ->
<sl-tag size="small"><%s tag %></sl-tag>
% end;
</div>
</div>
</div>
% end;
</body>
</html>
|