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
add standard.site validation
awarm.space
1 month ago
c1168189
8dc7f9b8
+41
-4
2 changed files
expand all
collapse all
unified
split
app
lish
[did]
[publication]
.well-known
site.standard.publication
route.ts
p
[didOrHandle]
[rkey]
page.tsx
+34
app/lish/[did]/[publication]/.well-known/site.standard.publication/route.ts
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
import { publicationNameOrUriFilter } from "src/utils/uriHelpers";
2
+
import { supabaseServerClient } from "supabase/serverClient";
3
+
4
+
export async function GET(
5
+
req: Request,
6
+
props: {
7
+
params: Promise<{ publication: string; did: string }>;
8
+
},
9
+
) {
10
+
let params = await props.params;
11
+
let did = decodeURIComponent(params.did);
12
+
let publication_name = decodeURIComponent(params.publication);
13
+
let [{ data: publications }] = await Promise.all([
14
+
supabaseServerClient
15
+
.from("publications")
16
+
.select(
17
+
`*,
18
+
publication_subscriptions(*),
19
+
documents_in_publications(documents(
20
+
*,
21
+
comments_on_documents(count),
22
+
document_mentions_in_bsky(count)
23
+
))
24
+
`,
25
+
)
26
+
.eq("identity_did", did)
27
+
.or(publicationNameOrUriFilter(did, publication_name))
28
+
.order("uri", { ascending: false })
29
+
.limit(1),
30
+
]);
31
+
let publication = publications?.[0];
32
+
if (!did || !publication) return new Response(null, { status: 404 });
33
+
return new Response(publication.uri);
34
+
}
+7
-4
app/p/[didOrHandle]/[rkey]/page.tsx
···
38
39
return {
40
icons: {
41
-
other: {
42
-
rel: "alternate",
43
-
url: document.uri,
44
-
},
0
0
0
45
},
46
title: docRecord.title,
47
description: docRecord?.description || "",
···
38
39
return {
40
icons: {
41
+
other: [
42
+
{
43
+
rel: "alternate",
44
+
url: document.uri,
45
+
},
46
+
{ rel: "site.standard.document", url: document.uri },
47
+
],
48
},
49
title: docRecord.title,
50
description: docRecord?.description || "",