tangled
alpha
login
or
join now
jordanreger.com
/
htmlsky
0
fork
atom
An HTML-only Bluesky frontend
0
fork
atom
overview
issues
pulls
pipelines
deno task clean and add viewport meta tag
jordanreger.com
2 years ago
98ac4941
a0eed12d
+13
-5
3 changed files
expand all
collapse all
unified
split
actor.ts
facets.ts
main.ts
+9
-3
actor.ts
···
34
return `
35
<head>
36
<meta name="color-scheme" content="light dark">
0
37
<title>${actor.username} (@${actor.handle}) — HTMLsky</title>
38
</head>
39
<table>
···
48
</h1>
49
</td>
50
</tr>
51
-
${actor.description ? `<tr>
0
0
52
<td colspan="2">
53
-
<p>${await getDescriptionFacets(actor.description).then(res => res.replaceAll("\n", "<br>"))}</p>
0
0
54
</td>
55
</tr>
56
<tr>
57
<td colspan="2"> </td>
58
</tr>`
59
-
: ``}
0
60
<tr>
61
<td colspan="2">
62
<b>${actor.followersCount}</b> followers
···
34
return `
35
<head>
36
<meta name="color-scheme" content="light dark">
37
+
<meta name="viewport" content="width=device-width, initial-scale=1">
38
<title>${actor.username} (@${actor.handle}) — HTMLsky</title>
39
</head>
40
<table>
···
49
</h1>
50
</td>
51
</tr>
52
+
${
53
+
actor.description
54
+
? `<tr>
55
<td colspan="2">
56
+
<p>${await getDescriptionFacets(actor.description).then((res) =>
57
+
res.replaceAll("\n", "<br>")
58
+
)}</p>
59
</td>
60
</tr>
61
<tr>
62
<td colspan="2"> </td>
63
</tr>`
64
+
: ``
65
+
}
66
<tr>
67
<td colspan="2">
68
<b>${actor.followersCount}</b> followers
+1
-1
facets.ts
···
1
-
import { AtpAgent, RichText } from "npm:@atproto/api";
2
import { agent } from "./main.ts";
3
4
export async function getDescriptionFacets(
···
1
+
import { RichText } from "npm:@atproto/api";
2
import { agent } from "./main.ts";
3
4
export async function getDescriptionFacets(
+3
-1
main.ts
···
31
}
32
33
// RAW PROFILE
34
-
const rawProfilePattern = new URLPattern({ pathname: "/raw/profile/:actor/" });
0
0
35
if (rawProfilePattern.test(url)) {
36
const actorName = rawProfilePattern.exec(url)?.pathname.groups.actor;
37
const actor = new Actor(actorName);
···
31
}
32
33
// RAW PROFILE
34
+
const rawProfilePattern = new URLPattern({
35
+
pathname: "/raw/profile/:actor/",
36
+
});
37
if (rawProfilePattern.test(url)) {
38
const actorName = rawProfilePattern.exec(url)?.pathname.groups.actor;
39
const actor = new Actor(actorName);