tangled
alpha
login
or
join now
apoena.dev
/
sequoia
forked from
stevedylan.dev/sequoia
A CLI for publishing standard.site documents to ATProto
0
fork
atom
overview
issues
pulls
pipelines
chore: added tags to flow
stevedylan.dev
1 week ago
44c3f8e2
81069f17
+18
2 changed files
expand all
collapse all
unified
split
packages
cli
src
commands
init.ts
lib
atproto.ts
+9
packages/cli/src/commands/init.ts
···
118
placeholder: "ogImage, coverImage, image, hero, etc.",
119
});
120
0
0
0
0
0
0
121
let frontmatterMapping: FrontmatterMapping | undefined = {};
122
123
if (titleField && titleField !== "title") {
···
131
}
132
if (coverField && coverField !== "ogImage") {
133
frontmatterMapping.coverImage = coverField as string;
0
0
0
134
}
135
136
// Only keep frontmatterMapping if it has any custom fields
···
118
placeholder: "ogImage, coverImage, image, hero, etc.",
119
});
120
121
+
const tagsField = await consola.prompt("Field name for tags:", {
122
+
type: "text",
123
+
default: "tags",
124
+
placeholder: "tags, categories, keywords, etc.",
125
+
});
126
+
127
let frontmatterMapping: FrontmatterMapping | undefined = {};
128
129
if (titleField && titleField !== "title") {
···
137
}
138
if (coverField && coverField !== "ogImage") {
139
frontmatterMapping.coverImage = coverField as string;
140
+
}
141
+
if (tagsField && tagsField !== "tags") {
142
+
frontmatterMapping.tags = tagsField as string;
143
}
144
145
// Only keep frontmatterMapping if it has any custom fields
+9
packages/cli/src/lib/atproto.ts
···
183
record.coverImage = coverImage;
184
}
185
0
0
0
0
186
const response = await agent.com.atproto.repo.createRecord({
187
repo: agent.session!.did,
188
collection: "site.standard.document",
···
227
record.coverImage = coverImage;
228
}
229
0
0
0
0
230
await agent.com.atproto.repo.putRecord({
231
repo: agent.session!.did,
232
collection: collection!,
···
254
publishedAt: string;
255
canonicalUrl?: string;
256
coverImage?: BlobObject;
0
257
location?: string;
258
}
259
···
183
record.coverImage = coverImage;
184
}
185
186
+
if (post.frontmatter.tags && post.frontmatter.tags.length > 0) {
187
+
record.tags = post.frontmatter.tags;
188
+
}
189
+
190
const response = await agent.com.atproto.repo.createRecord({
191
repo: agent.session!.did,
192
collection: "site.standard.document",
···
231
record.coverImage = coverImage;
232
}
233
234
+
if (post.frontmatter.tags && post.frontmatter.tags.length > 0) {
235
+
record.tags = post.frontmatter.tags;
236
+
}
237
+
238
await agent.com.atproto.repo.putRecord({
239
repo: agent.session!.did,
240
collection: collection!,
···
262
publishedAt: string;
263
canonicalUrl?: string;
264
coverImage?: BlobObject;
265
+
tags?: string[];
266
location?: string;
267
}
268