+1
-1
flake.nix
+1
-1
flake.nix
+2
-1
package.json
+2
-1
package.json
src/assets/NerdIosevka-Regular.woff2
src/assets/NerdIosevka-Regular.woff2
This is a binary file and will not be displayed.
+1
-1
src/auth/client.ts
+1
-1
src/auth/client.ts
+1
-1
src/mixins/head.pug
+1
-1
src/mixins/head.pug
-2
src/mixins/header.pug
-2
src/mixins/header.pug
+13
-2
src/public/styles.css
+13
-2
src/public/styles.css
···
1
-
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');
2
3
:root {
4
/* Light mode colors */
···
28
}
29
30
* {
31
-
font-family: 'IBM Plex Mono', monospace;
32
}
33
34
body {
···
55
background-color: var(--bg-color-muted);
56
padding: 1rem;
57
overflow-x: auto;
58
}
59
60
input, textarea, select, button {
···
1
+
@font-face {
2
+
font-family: 'NerdIosevka';
3
+
src: url('../assets/NerdIosevka-Regular.woff2') format('woff2');
4
+
font-weight: normal;
5
+
font-style: monospace;
6
+
}
7
8
:root {
9
/* Light mode colors */
···
33
}
34
35
* {
36
+
font-family: 'NerdIosevka', monospace;
37
+
font-size: 0.9rem;
38
}
39
40
body {
···
61
background-color: var(--bg-color-muted);
62
padding: 1rem;
63
overflow-x: auto;
64
+
}
65
+
66
+
.comment-body {
67
+
background-color: var(--bg-color);
68
+
padding: 0;
69
}
70
71
input, textarea, select, button {
+11
-8
src/routes.ts
+11
-8
src/routes.ts
···
49
export const createRouter = (ctx: Ctx) => {
50
const router = express.Router();
51
52
// OAuth metadata
53
router.get("/client-metadata.json", async (_req, res) => {
54
return res.json(ctx.oauthClient.clientMetadata);
···
193
authorDid: pasteAuthorDid,
194
};
195
196
-
const comments = ret.map((row) => {
197
-
return {
198
-
uri: row.commentUri,
199
-
authorDid: row.commentAuthorDid,
200
-
body: row.commentBody,
201
-
createdAt: row.commentCreatedAt,
202
-
};
203
-
});
204
205
const ownAgent = await getSessionAgent(req, res, ctx);
206
if (!ownAgent) {
···
49
export const createRouter = (ctx: Ctx) => {
50
const router = express.Router();
51
52
+
router.use("/assets", express.static(path.join(__dirname, "assets")));
53
// OAuth metadata
54
router.get("/client-metadata.json", async (_req, res) => {
55
return res.json(ctx.oauthClient.clientMetadata);
···
194
authorDid: pasteAuthorDid,
195
};
196
197
+
const comments = ret
198
+
.filter((row) => row.commentUri)
199
+
.map((row) => {
200
+
return {
201
+
uri: row.commentUri,
202
+
authorDid: row.commentAuthorDid,
203
+
body: row.commentBody,
204
+
createdAt: row.commentCreatedAt,
205
+
};
206
+
});
207
208
const ownAgent = await getSessionAgent(req, res, ctx);
209
if (!ownAgent) {
+3
-8
src/views/login.pug
+3
-8
src/views/login.pug
···
1
doctype html
2
html
3
-
head
4
-
meta(name="viewport" content="width=device-width, initial-scale=1.0")
5
-
meta(charset='UTF-8')
6
-
title login
7
-
link(rel="stylesheet", href="/styles.css")
8
-
link(rel="preconnect" href="https://rsms.me/")
9
-
link(rel="stylesheet" href="https://rsms.me/inter/inter.css")
10
-
script(src="https://cdn.dashjs.org/latest/dash.all.min.js")
11
body
12
main#content
13
h1 login
+15
-11
src/views/paste.pug
+15
-11
src/views/paste.pug
···
4
include ../mixins/utils
5
doctype html
6
html
7
-
+head(paste.title)
8
body
9
main#content
10
+header(ownDid, didHandleMap)
11
h1 #{paste.title}
12
p
13
-
| by @#{didHandleMap[paste.authorDid]} ·
14
| #{timeDifference(now, Date.parse(paste.createdAt))} ago ·
15
| #{paste.lang} ·
16
| #{paste.code.split('\n').length} loc ·
···
19
| #{paste.code}
20
hr
21
22
-
div.comments
23
-
each comment in comments
24
-
div.comment(id=`${encodeURIComponent(comment.uri)}`)
25
-
p
26
-
| by @#{didHandleMap[comment.authorDid]} ·
27
-
| #{timeDifference(now, Date.parse(paste.createdAt))} ago
28
-
p
29
-
| #{comment.body}
30
-
hr
31
32
form(action=`/${encodeURIComponent(paste.uri)}/comment` method="post").post-form
33
div.post-row
···
4
include ../mixins/utils
5
doctype html
6
html
7
+
+head(`${paste.title} · ${didHandleMap[paste.authorDid]}`)
8
body
9
main#content
10
+header(ownDid, didHandleMap)
11
h1 #{paste.title}
12
p
13
+
| @#{didHandleMap[paste.authorDid]} ·
14
| #{timeDifference(now, Date.parse(paste.createdAt))} ago ·
15
| #{paste.lang} ·
16
| #{paste.code.split('\n').length} loc ·
···
19
| #{paste.code}
20
hr
21
22
+
if comments.length != 0
23
+
h1 comments
24
+
div.comments
25
+
each comment in comments
26
+
div.comment(id=`${encodeURIComponent(comment.uri)}`)
27
+
p
28
+
a(href=`/u/${comment.authorDid}`)
29
+
| @#{didHandleMap[comment.authorDid]}
30
+
| ·
31
+
| #{timeDifference(now, Date.parse(paste.createdAt))} ago
32
+
p
33
+
pre.comment-body #{comment.body}
34
+
hr
35
36
form(action=`/${encodeURIComponent(paste.uri)}/comment` method="post").post-form
37
div.post-row