@bryanguffey/astro-standard-site 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +348 -0
- package/components/Comments.astro +330 -0
- package/dist/comments.d.ts +97 -0
- package/dist/comments.d.ts.map +1 -0
- package/dist/comments.js +221 -0
- package/dist/comments.js.map +1 -0
- package/dist/content.d.ts +141 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +202 -0
- package/dist/content.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/loader.d.ts +181 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +207 -0
- package/dist/loader.js.map +1 -0
- package/dist/publisher.d.ts +157 -0
- package/dist/publisher.d.ts.map +1 -0
- package/dist/publisher.js +326 -0
- package/dist/publisher.js.map +1 -0
- package/dist/schemas.d.ts +1079 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +154 -0
- package/dist/schemas.js.map +1 -0
- package/dist/verification.d.ts +103 -0
- package/dist/verification.d.ts.map +1 -0
- package/dist/verification.js +111 -0
- package/dist/verification.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../src/content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAoBH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,2CAA2C;IAC3C,MAAM,aAAa,GAAG,wIAAwI,CAAC;IAE/J,OAAO,QAAQ,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACjE,uBAAuB;QACvB,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QACpC,MAAM,UAAU,G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,CAAC;IAEH,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,OAAO;QACrB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;QACtB,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QACzC,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW;QAClC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;QACpB,WAAW,EAAE,WAAW,CAAC,WAAW;QACpC,OAAO,EAAE;YACP,KAAK,EAAE,gCAAgC;YACvC,IAAI,EAAE,WAAW,CAAC,QAAQ;YAC1B,OAAO,EAAE,KAAK;SACf;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* astro-standard-site
|
|
3
|
+
*
|
|
4
|
+
* The first Astro integration for standard.site - unified ATProto longform publishing.
|
|
5
|
+
*
|
|
6
|
+
* This package provides:
|
|
7
|
+
* - A loader for fetching documents from ATProto repositories
|
|
8
|
+
* - A publisher for syncing your Astro content to ATProto platforms (Leaflet, WhiteWind, etc.)
|
|
9
|
+
* - Content transformation utilities (sidenotes, relative links, plain text extraction)
|
|
10
|
+
* - Comment aggregation from Bluesky and other ATProto platforms
|
|
11
|
+
* - Verification utilities for the standard.site specification
|
|
12
|
+
* - Type-safe schemas matching the lexicon definitions
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // Publish a blog post to ATProto
|
|
17
|
+
* import { StandardSitePublisher, transformPost } from 'astro-standard-site';
|
|
18
|
+
*
|
|
19
|
+
* const publisher = new StandardSitePublisher({
|
|
20
|
+
* identifier: 'your-handle.bsky.social',
|
|
21
|
+
* password: process.env.ATPROTO_APP_PASSWORD!,
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* await publisher.login();
|
|
25
|
+
* const doc = transformPost(post, { siteUrl: 'https://yoursite.com' });
|
|
26
|
+
* await publisher.publishDocument(doc);
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* // Fetch comments from Bluesky
|
|
32
|
+
* import { fetchComments } from 'astro-standard-site';
|
|
33
|
+
*
|
|
34
|
+
* const comments = await fetchComments({
|
|
35
|
+
* bskyPostUri: 'at://did:plc:xxx/app.bsky.feed.post/abc123',
|
|
36
|
+
* canonicalUrl: 'https://yoursite.com/blog/post',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @see https://standard.site for the specification
|
|
41
|
+
*/
|
|
42
|
+
export { standardSiteLoader, publicationLoader, type StandardSiteDocument, type StandardSitePublication, type LoaderConfig, } from './loader.js';
|
|
43
|
+
export { StandardSitePublisher, type PublishDocumentInput, type PublishPublicationInput, type PublishResult, type PublisherConfig, } from './publisher.js';
|
|
44
|
+
export { PublicationSchema, DocumentSchema, ThemeBasicSchema, ThemeColorSchema, StrongRefSchema, LoaderConfigSchema, PublisherConfigSchema, AtUriSchema, type Publication, type Document, type ThemeBasic, type ThemeColor, type StrongRef, COLLECTIONS, } from './schemas.js';
|
|
45
|
+
export { generatePublicationWellKnown, generateDocumentLinkTag, getDocumentAtUri, getPublicationAtUri, parseAtUri, standardSiteVerification, type VerificationConfig, } from './verification.js';
|
|
46
|
+
export { transformContent, transformPost, convertSidenotes, convertComplexSidenotes, resolveRelativeLinks, stripToPlainText, countWords, calculateReadingTime, type TransformOptions, type TransformResult, type AstroBlogPost, type StandardSiteDocumentInput, } from './content.js';
|
|
47
|
+
export { fetchComments, fetchBlueskyReplies, searchBlueskyMentions, buildCommentTree, flattenComments, countComments, type Comment, type Author, type FetchCommentsOptions, } from './comments.js';
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAGH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,GAClB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAEL,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EAGX,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EAGd,WAAW,GACZ,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,wBAAwB,EACxB,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,yBAAyB,GAC/B,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* astro-standard-site
|
|
3
|
+
*
|
|
4
|
+
* The first Astro integration for standard.site - unified ATProto longform publishing.
|
|
5
|
+
*
|
|
6
|
+
* This package provides:
|
|
7
|
+
* - A loader for fetching documents from ATProto repositories
|
|
8
|
+
* - A publisher for syncing your Astro content to ATProto platforms (Leaflet, WhiteWind, etc.)
|
|
9
|
+
* - Content transformation utilities (sidenotes, relative links, plain text extraction)
|
|
10
|
+
* - Comment aggregation from Bluesky and other ATProto platforms
|
|
11
|
+
* - Verification utilities for the standard.site specification
|
|
12
|
+
* - Type-safe schemas matching the lexicon definitions
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // Publish a blog post to ATProto
|
|
17
|
+
* import { StandardSitePublisher, transformPost } from 'astro-standard-site';
|
|
18
|
+
*
|
|
19
|
+
* const publisher = new StandardSitePublisher({
|
|
20
|
+
* identifier: 'your-handle.bsky.social',
|
|
21
|
+
* password: process.env.ATPROTO_APP_PASSWORD!,
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* await publisher.login();
|
|
25
|
+
* const doc = transformPost(post, { siteUrl: 'https://yoursite.com' });
|
|
26
|
+
* await publisher.publishDocument(doc);
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* // Fetch comments from Bluesky
|
|
32
|
+
* import { fetchComments } from 'astro-standard-site';
|
|
33
|
+
*
|
|
34
|
+
* const comments = await fetchComments({
|
|
35
|
+
* bskyPostUri: 'at://did:plc:xxx/app.bsky.feed.post/abc123',
|
|
36
|
+
* canonicalUrl: 'https://yoursite.com/blog/post',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @see https://standard.site for the specification
|
|
41
|
+
*/
|
|
42
|
+
// Re-export loader
|
|
43
|
+
export { standardSiteLoader, publicationLoader, } from './loader.js';
|
|
44
|
+
// Re-export publisher
|
|
45
|
+
export { StandardSitePublisher, } from './publisher.js';
|
|
46
|
+
// Re-export schemas
|
|
47
|
+
export {
|
|
48
|
+
// Zod schemas
|
|
49
|
+
PublicationSchema, DocumentSchema, ThemeBasicSchema, ThemeColorSchema, StrongRefSchema, LoaderConfigSchema, PublisherConfigSchema, AtUriSchema,
|
|
50
|
+
// Constants
|
|
51
|
+
COLLECTIONS, } from './schemas.js';
|
|
52
|
+
// Re-export verification utilities
|
|
53
|
+
export { generatePublicationWellKnown, generateDocumentLinkTag, getDocumentAtUri, getPublicationAtUri, parseAtUri, standardSiteVerification, } from './verification.js';
|
|
54
|
+
// Re-export content transformation utilities
|
|
55
|
+
export { transformContent, transformPost, convertSidenotes, convertComplexSidenotes, resolveRelativeLinks, stripToPlainText, countWords, calculateReadingTime, } from './content.js';
|
|
56
|
+
// Re-export comment utilities
|
|
57
|
+
export { fetchComments, fetchBlueskyReplies, searchBlueskyMentions, buildCommentTree, flattenComments, countComments, } from './comments.js';
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,mBAAmB;AACnB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAIlB,MAAM,aAAa,CAAC;AAErB,sBAAsB;AACtB,OAAO,EACL,qBAAqB,GAKtB,MAAM,gBAAgB,CAAC;AAExB,oBAAoB;AACpB,OAAO;AACL,cAAc;AACd,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,WAAW;AASX,YAAY;AACZ,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,mCAAmC;AACnC,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,wBAAwB,GAEzB,MAAM,mBAAmB,CAAC;AAE3B,6CAA6C;AAC7C,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,oBAAoB,GAKrB,MAAM,cAAc,CAAC;AAEtB,8BAA8B;AAC9B,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,aAAa,GAId,MAAM,eAAe,CAAC"}
|
package/dist/loader.d.ts
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Astro Content Layer Loader for standard.site
|
|
3
|
+
*
|
|
4
|
+
* Fetches documents from ATProto repositories that use the standard.site lexicon,
|
|
5
|
+
* enabling unified access to content from Leaflet, WhiteWind, and other compatible platforms.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* // src/content/config.ts
|
|
10
|
+
* import { defineCollection } from 'astro:content';
|
|
11
|
+
* import { standardSiteLoader } from 'astro-standard-site/loader';
|
|
12
|
+
*
|
|
13
|
+
* const blog = defineCollection({
|
|
14
|
+
* loader: standardSiteLoader({ repo: 'your-handle.bsky.social' }),
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* export const collections = { blog };
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
import type { LoaderConfig, Document, Publication } from './schemas.js';
|
|
21
|
+
export interface StandardSiteDocument {
|
|
22
|
+
/** Unique ID derived from the record key (tid) */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Full AT-URI of the document */
|
|
25
|
+
uri: string;
|
|
26
|
+
/** Content hash (CID) */
|
|
27
|
+
cid: string;
|
|
28
|
+
/** Document title - REQUIRED */
|
|
29
|
+
title: string;
|
|
30
|
+
/** Site/publication URI (https or at-uri) - REQUIRED */
|
|
31
|
+
site: string;
|
|
32
|
+
/** When published - REQUIRED */
|
|
33
|
+
publishedAt: Date;
|
|
34
|
+
/** Path to append to site URL */
|
|
35
|
+
path?: string;
|
|
36
|
+
/** Full URL (computed from site + path if available) */
|
|
37
|
+
url?: string;
|
|
38
|
+
/** Document description/excerpt */
|
|
39
|
+
description?: string;
|
|
40
|
+
/** Last updated date */
|
|
41
|
+
updatedAt?: Date;
|
|
42
|
+
/** Tags/categories */
|
|
43
|
+
tags: string[];
|
|
44
|
+
/** Cover image blob reference */
|
|
45
|
+
coverImage?: {
|
|
46
|
+
cid: string;
|
|
47
|
+
mimeType: string;
|
|
48
|
+
size: number;
|
|
49
|
+
};
|
|
50
|
+
/** Reference to associated Bluesky post */
|
|
51
|
+
bskyPostRef?: {
|
|
52
|
+
uri: string;
|
|
53
|
+
cid: string;
|
|
54
|
+
};
|
|
55
|
+
/** Plain text content for search/indexing */
|
|
56
|
+
textContent?: string;
|
|
57
|
+
/** Platform-specific content (varies by platform) */
|
|
58
|
+
content?: unknown;
|
|
59
|
+
/** Raw record value for advanced use cases */
|
|
60
|
+
_raw: Document;
|
|
61
|
+
}
|
|
62
|
+
export interface StandardSitePublication {
|
|
63
|
+
/** Unique ID derived from the record key */
|
|
64
|
+
id: string;
|
|
65
|
+
/** Full AT-URI */
|
|
66
|
+
uri: string;
|
|
67
|
+
/** Content hash */
|
|
68
|
+
cid: string;
|
|
69
|
+
/** Publication name */
|
|
70
|
+
name: string;
|
|
71
|
+
/** Base URL */
|
|
72
|
+
url: string;
|
|
73
|
+
/** Description */
|
|
74
|
+
description?: string;
|
|
75
|
+
/** Icon blob reference */
|
|
76
|
+
icon?: {
|
|
77
|
+
cid: string;
|
|
78
|
+
mimeType: string;
|
|
79
|
+
size: number;
|
|
80
|
+
};
|
|
81
|
+
/** Raw record value */
|
|
82
|
+
_raw: Publication;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Creates an Astro Content Layer loader for standard.site documents
|
|
86
|
+
*
|
|
87
|
+
* @param config - Loader configuration
|
|
88
|
+
* @returns Astro loader object
|
|
89
|
+
*/
|
|
90
|
+
export declare function standardSiteLoader(config: Partial<LoaderConfig>): {
|
|
91
|
+
name: string;
|
|
92
|
+
load({ store, logger, generateDigest }: {
|
|
93
|
+
store: {
|
|
94
|
+
set: (entry: {
|
|
95
|
+
id: string;
|
|
96
|
+
data: unknown;
|
|
97
|
+
digest?: string;
|
|
98
|
+
}) => void;
|
|
99
|
+
clear: () => void;
|
|
100
|
+
};
|
|
101
|
+
logger: {
|
|
102
|
+
info: (msg: string) => void;
|
|
103
|
+
warn: (msg: string) => void;
|
|
104
|
+
error: (msg: string) => void;
|
|
105
|
+
};
|
|
106
|
+
generateDigest: (data: unknown) => string;
|
|
107
|
+
}): Promise<void>;
|
|
108
|
+
/** Schema for Astro content collections */
|
|
109
|
+
schema: () => {
|
|
110
|
+
id: {
|
|
111
|
+
type: "string";
|
|
112
|
+
};
|
|
113
|
+
uri: {
|
|
114
|
+
type: "string";
|
|
115
|
+
};
|
|
116
|
+
cid: {
|
|
117
|
+
type: "string";
|
|
118
|
+
};
|
|
119
|
+
title: {
|
|
120
|
+
type: "string";
|
|
121
|
+
optional: boolean;
|
|
122
|
+
};
|
|
123
|
+
description: {
|
|
124
|
+
type: "string";
|
|
125
|
+
optional: boolean;
|
|
126
|
+
};
|
|
127
|
+
url: {
|
|
128
|
+
type: "string";
|
|
129
|
+
optional: boolean;
|
|
130
|
+
};
|
|
131
|
+
publishedAt: {
|
|
132
|
+
type: "date";
|
|
133
|
+
optional: boolean;
|
|
134
|
+
};
|
|
135
|
+
updatedAt: {
|
|
136
|
+
type: "date";
|
|
137
|
+
optional: boolean;
|
|
138
|
+
};
|
|
139
|
+
tags: {
|
|
140
|
+
type: "array";
|
|
141
|
+
items: {
|
|
142
|
+
type: "string";
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
visibility: {
|
|
146
|
+
type: "string";
|
|
147
|
+
enum: string[];
|
|
148
|
+
};
|
|
149
|
+
publication: {
|
|
150
|
+
type: "string";
|
|
151
|
+
optional: boolean;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Creates a loader specifically for standard.site publications
|
|
157
|
+
*/
|
|
158
|
+
export declare function publicationLoader(config: {
|
|
159
|
+
repo: string;
|
|
160
|
+
service?: string;
|
|
161
|
+
}): {
|
|
162
|
+
name: string;
|
|
163
|
+
load({ store, logger, generateDigest }: {
|
|
164
|
+
store: {
|
|
165
|
+
set: (entry: {
|
|
166
|
+
id: string;
|
|
167
|
+
data: unknown;
|
|
168
|
+
digest?: string;
|
|
169
|
+
}) => void;
|
|
170
|
+
clear: () => void;
|
|
171
|
+
};
|
|
172
|
+
logger: {
|
|
173
|
+
info: (msg: string) => void;
|
|
174
|
+
warn: (msg: string) => void;
|
|
175
|
+
error: (msg: string) => void;
|
|
176
|
+
};
|
|
177
|
+
generateDigest: (data: unknown) => string;
|
|
178
|
+
}): Promise<void>;
|
|
179
|
+
};
|
|
180
|
+
export type { LoaderConfig };
|
|
181
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAQxE,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,WAAW,EAAE,IAAI,CAAC;IAClB,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,WAAW,CAAC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
*
|
|
4
|
+
* Fetches documents from ATProto repositories that use the standard.site lexicon,
|
|
5
|
+
* enabling unified access to content from Leaflet, WhiteWind, and other compatible platforms.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* // src/content/config.ts
|
|
10
|
+
* import { defineCollection } from 'astro:content';
|
|
11
|
+
* import { standardSiteLoader } from 'astro-standard-site/loader';
|
|
12
|
+
*
|
|
13
|
+
* const blog = defineCollection({
|
|
14
|
+
* loader: standardSiteLoader({ repo: 'your-handle.bsky.social' }),
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* export const collections = { blog };
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
import { AtpAgent } from '@atproto/api';
|
|
21
|
+
import { LoaderConfigSchema, DocumentSchema, PublicationSchema, COLLECTIONS } from './schemas.js';
|
|
22
|
+
/**
|
|
23
|
+
* Parse an AT-URI to extract its components
|
|
24
|
+
*/
|
|
25
|
+
function parseAtUri(uri) {
|
|
26
|
+
const match = uri.match(/^at:\/\/([^/]+)\/([^/]+)\/(.+)$/);
|
|
27
|
+
if (!match)
|
|
28
|
+
return null;
|
|
29
|
+
return {
|
|
30
|
+
repo: match[1],
|
|
31
|
+
collection: match[2],
|
|
32
|
+
rkey: match[3],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Creates an Astro Content Layer loader for standard.site documents
|
|
37
|
+
*
|
|
38
|
+
* @param config - Loader configuration
|
|
39
|
+
* @returns Astro loader object
|
|
40
|
+
*/
|
|
41
|
+
export function standardSiteLoader(config) {
|
|
42
|
+
const validatedConfig = LoaderConfigSchema.parse(config);
|
|
43
|
+
return {
|
|
44
|
+
name: 'standard-site-loader',
|
|
45
|
+
async load({ store, logger, generateDigest }) {
|
|
46
|
+
logger.info(`Loading documents from ${validatedConfig.repo}`);
|
|
47
|
+
const agent = new AtpAgent({ service: validatedConfig.service });
|
|
48
|
+
try {
|
|
49
|
+
// Resolve handle to DID if necessary
|
|
50
|
+
let did = validatedConfig.repo;
|
|
51
|
+
if (!did.startsWith('did:')) {
|
|
52
|
+
const resolved = await agent.resolveHandle({ handle: validatedConfig.repo });
|
|
53
|
+
did = resolved.data.did;
|
|
54
|
+
logger.info(`Resolved ${validatedConfig.repo} to ${did}`);
|
|
55
|
+
}
|
|
56
|
+
// Fetch documents from the standard.site.document collection
|
|
57
|
+
const response = await agent.api.com.atproto.repo.listRecords({
|
|
58
|
+
repo: did,
|
|
59
|
+
collection: COLLECTIONS.DOCUMENT,
|
|
60
|
+
limit: validatedConfig.limit,
|
|
61
|
+
});
|
|
62
|
+
logger.info(`Found ${response.data.records.length} documents`);
|
|
63
|
+
// Clear existing entries before loading new ones
|
|
64
|
+
store.clear();
|
|
65
|
+
for (const record of response.data.records) {
|
|
66
|
+
try {
|
|
67
|
+
// Parse and validate the document
|
|
68
|
+
const parsed = parseAtUri(record.uri);
|
|
69
|
+
if (!parsed) {
|
|
70
|
+
logger.warn(`Invalid AT-URI: ${record.uri}`);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const docResult = DocumentSchema.safeParse(record.value);
|
|
74
|
+
if (!docResult.success) {
|
|
75
|
+
logger.warn(`Invalid document schema for ${record.uri}: ${docResult.error.message}`);
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const doc = docResult.data;
|
|
79
|
+
// Filter by site/publication if specified
|
|
80
|
+
if (validatedConfig.publication && doc.site !== validatedConfig.publication) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
// Compute full URL from site + path
|
|
84
|
+
let fullUrl;
|
|
85
|
+
if (doc.path) {
|
|
86
|
+
const baseUrl = doc.site.replace(/\/$/, '');
|
|
87
|
+
const path = doc.path.startsWith('/') ? doc.path : `/${doc.path}`;
|
|
88
|
+
fullUrl = `${baseUrl}${path}`;
|
|
89
|
+
}
|
|
90
|
+
// Transform to loader entry
|
|
91
|
+
const entry = {
|
|
92
|
+
id: parsed.rkey,
|
|
93
|
+
uri: record.uri,
|
|
94
|
+
cid: record.cid,
|
|
95
|
+
title: doc.title,
|
|
96
|
+
site: doc.site,
|
|
97
|
+
publishedAt: new Date(doc.publishedAt),
|
|
98
|
+
path: doc.path,
|
|
99
|
+
url: fullUrl,
|
|
100
|
+
description: doc.description,
|
|
101
|
+
updatedAt: doc.updatedAt ? new Date(doc.updatedAt) : undefined,
|
|
102
|
+
tags: doc.tags ?? [],
|
|
103
|
+
coverImage: doc.coverImage ? {
|
|
104
|
+
cid: doc.coverImage.ref.$link,
|
|
105
|
+
mimeType: doc.coverImage.mimeType,
|
|
106
|
+
size: doc.coverImage.size,
|
|
107
|
+
} : undefined,
|
|
108
|
+
bskyPostRef: doc.bskyPostRef,
|
|
109
|
+
textContent: doc.textContent,
|
|
110
|
+
content: doc.content,
|
|
111
|
+
_raw: doc,
|
|
112
|
+
};
|
|
113
|
+
store.set({
|
|
114
|
+
id: entry.id,
|
|
115
|
+
data: entry,
|
|
116
|
+
digest: generateDigest(entry),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
logger.warn(`Error processing record ${record.uri}: ${err}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
logger.info(`Successfully loaded ${response.data.records.length} documents`);
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
logger.error(`Failed to load documents: ${err}`);
|
|
127
|
+
throw err;
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
/** Schema for Astro content collections */
|
|
131
|
+
schema: () => ({
|
|
132
|
+
id: { type: 'string' },
|
|
133
|
+
uri: { type: 'string' },
|
|
134
|
+
cid: { type: 'string' },
|
|
135
|
+
title: { type: 'string', optional: true },
|
|
136
|
+
description: { type: 'string', optional: true },
|
|
137
|
+
url: { type: 'string', optional: true },
|
|
138
|
+
publishedAt: { type: 'date', optional: true },
|
|
139
|
+
updatedAt: { type: 'date', optional: true },
|
|
140
|
+
tags: { type: 'array', items: { type: 'string' } },
|
|
141
|
+
visibility: { type: 'string', enum: ['public', 'unlisted', 'private'] },
|
|
142
|
+
publication: { type: 'string', optional: true },
|
|
143
|
+
}),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Creates a loader specifically for standard.site publications
|
|
148
|
+
*/
|
|
149
|
+
export function publicationLoader(config) {
|
|
150
|
+
return {
|
|
151
|
+
name: 'standard-site-publication-loader',
|
|
152
|
+
async load({ store, logger, generateDigest }) {
|
|
153
|
+
const service = config.service ?? 'https://bsky.social';
|
|
154
|
+
logger.info(`Loading publications from ${config.repo}`);
|
|
155
|
+
const agent = new AtpAgent({ service });
|
|
156
|
+
try {
|
|
157
|
+
let did = config.repo;
|
|
158
|
+
if (!did.startsWith('did:')) {
|
|
159
|
+
const resolved = await agent.resolveHandle({ handle: config.repo });
|
|
160
|
+
did = resolved.data.did;
|
|
161
|
+
}
|
|
162
|
+
const response = await agent.api.com.atproto.repo.listRecords({
|
|
163
|
+
repo: did,
|
|
164
|
+
collection: COLLECTIONS.PUBLICATION,
|
|
165
|
+
limit: 100,
|
|
166
|
+
});
|
|
167
|
+
store.clear();
|
|
168
|
+
for (const record of response.data.records) {
|
|
169
|
+
const parsed = parseAtUri(record.uri);
|
|
170
|
+
if (!parsed)
|
|
171
|
+
continue;
|
|
172
|
+
const pubResult = PublicationSchema.safeParse(record.value);
|
|
173
|
+
if (!pubResult.success) {
|
|
174
|
+
logger.warn(`Invalid publication schema: ${pubResult.error.message}`);
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
const pub = pubResult.data;
|
|
178
|
+
const entry = {
|
|
179
|
+
id: parsed.rkey,
|
|
180
|
+
uri: record.uri,
|
|
181
|
+
cid: record.cid,
|
|
182
|
+
name: pub.name,
|
|
183
|
+
url: pub.url,
|
|
184
|
+
description: pub.description,
|
|
185
|
+
icon: pub.icon ? {
|
|
186
|
+
cid: pub.icon.ref.$link,
|
|
187
|
+
mimeType: pub.icon.mimeType,
|
|
188
|
+
size: pub.icon.size,
|
|
189
|
+
} : undefined,
|
|
190
|
+
_raw: pub,
|
|
191
|
+
};
|
|
192
|
+
store.set({
|
|
193
|
+
id: entry.id,
|
|
194
|
+
data: entry,
|
|
195
|
+
digest: generateDigest(entry),
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
logger.info(`Loaded ${response.data.records.length} publications`);
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
logger.error(`Failed to load publications: ${err}`);
|
|
202
|
+
throw err;
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACZ,MAAM,cAAc,CAAC;AAmEtB;;GAEG;AACH,SAAS,UAAU,CAAC,GAAW;IAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAC3D,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QACd,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;QACpB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;KACf,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAA6B;IAC9D,MAAM,eAAe,GAAG,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEzD,OAAO;QACL,IAAI,EAAE,sBAAsB;QAE5B,KAAK,CAAC,IAAI,CAAC,EAA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