tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
27
pulls
pipelines
fix pub favicons
awarm.space
3 months ago
afa115e8
571cb611
+22
-8
3 changed files
expand all
collapse all
unified
split
app
lish
[did]
[publication]
[rkey]
page.tsx
icon
route.ts
layout.tsx
+7
app/lish/[did]/[publication]/[rkey]/page.tsx
···
25
25
26
26
return {
27
27
icons: {
28
28
+
icon: {
29
29
+
30
30
+
url:
31
31
+
process.env.NODE_ENV === "development"
32
32
+
? `/lish/${did}/${params.publication}/icon`
33
33
+
: "/icon",
34
34
+
, sizes: "32x32", type: "image/png" },
28
35
other: {
29
36
rel: "alternate",
30
37
url: document.uri,
+7
-8
app/lish/[did]/[publication]/icon.ts
app/lish/[did]/[publication]/icon/route.ts
···
8
8
9
9
let idResolver = new IdResolver();
10
10
11
11
-
export const size = {
12
12
-
width: 32,
13
13
-
height: 32,
14
14
-
};
11
11
+
export const dynamic = "force-dynamic";
15
12
16
16
-
export const contentType = "image/png";
17
17
-
export default async function Icon(props: {
18
18
-
params: Promise<{ did: string; publication: string }>;
19
19
-
}) {
13
13
+
export async function GET(
14
14
+
request: NextRequest,
15
15
+
props: { params: Promise<{ did: string; publication: string }> }
16
16
+
) {
17
17
+
console.log("are we getting here?");
20
18
const params = await props.params;
21
19
try {
22
20
let did = decodeURIComponent(params.did);
···
63
61
},
64
62
});
65
63
} catch (e) {
64
64
+
console.log(e);
66
65
return redirect("/icon.png");
67
66
}
68
67
}
+8
app/lish/[did]/[publication]/layout.tsx
···
47
47
title: pubRecord?.name || "Untitled Publication",
48
48
description: pubRecord?.description || "",
49
49
icons: {
50
50
+
icon: {
51
51
+
url:
52
52
+
process.env.NODE_ENV === "development"
53
53
+
? `/lish/${did}/${publication_name}/icon`
54
54
+
: "/icon",
55
55
+
sizes: "32x32",
56
56
+
type: "image/png",
57
57
+
},
50
58
other: {
51
59
rel: "alternate",
52
60
url: publication.uri,