-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.templ
More file actions
66 lines (51 loc) · 2.26 KB
/
list.templ
File metadata and controls
66 lines (51 loc) · 2.26 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package notezero
import (
"fmt"
)
templ ListArticleTemplate(params ListArticleParams) {
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" />
<link href="https://fonts.googleapis.com/css2?family=Fira+Code&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="/static/style.css" type="text/css" />
<script src="https://unpkg.com/htmx.org@1.9.2"></script>
</head>
<body hx-boost="true">
<main>
<article class="article-cards">
for _, note := range params.Notes {
<article id={ fmt.Sprintf("%s", note.Naddr()) } class="article-card-container">
<div id="content-area" class="article-card-body">
<header class="article-card-header"
hx-get={ fmt.Sprintf("/nz/%s/%s", note.Npub(), note.Naddr()) }
hx-push-url="true"
hx-target="body"
hx-swap="outerHTML">
{ note.Title() }
</header>
<div class="tags">
for _, v := range note.HashTags() {
<h2 class="tag"
hx-get="hashtag/{ v }"
hx-push-url="true"
hx-target="body"
hx-swap="outerHTML">
{ v }
</h2>
}
</div>
<hr class="custom-divider"/>
<b class="card-date">
{ note.CreatedAtStr() }
</b>
</div>
</article>
}
</article>
</main>
</body>
</html>
}