aboutsummaryrefslogtreecommitdiff
path: root/bin/template.eml
blob: 69d5dea6d35ee9a780e62e4d6f28f44627e0365b (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
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 Links</title>
  </head>
  <body style="display:flex; flex-direction:column; align-items:center">
    <h1>Sensemaking Links</h1>
    <div>
      <sl-button variant="text" size="medium" hx-post="/login" hx-swap="outerHTML">login</sl-button>
      <sl-button variant="text" size="medium">rss</sl-button>
    </div>
%    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>