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
118
placeholder: "ogImage, coverImage, image, hero, etc.",
119
119
});
120
120
121
121
+
const tagsField = await consola.prompt("Field name for tags:", {
122
122
+
type: "text",
123
123
+
default: "tags",
124
124
+
placeholder: "tags, categories, keywords, etc.",
125
125
+
});
126
126
+
121
127
let frontmatterMapping: FrontmatterMapping | undefined = {};
122
128
123
129
if (titleField && titleField !== "title") {
···
131
137
}
132
138
if (coverField && coverField !== "ogImage") {
133
139
frontmatterMapping.coverImage = coverField as string;
140
140
+
}
141
141
+
if (tagsField && tagsField !== "tags") {
142
142
+
frontmatterMapping.tags = tagsField as string;
134
143
}
135
144
136
145
// Only keep frontmatterMapping if it has any custom fields
+9
packages/cli/src/lib/atproto.ts
···
183
183
record.coverImage = coverImage;
184
184
}
185
185
186
186
+
if (post.frontmatter.tags && post.frontmatter.tags.length > 0) {
187
187
+
record.tags = post.frontmatter.tags;
188
188
+
}
189
189
+
186
190
const response = await agent.com.atproto.repo.createRecord({
187
191
repo: agent.session!.did,
188
192
collection: "site.standard.document",
···
227
231
record.coverImage = coverImage;
228
232
}
229
233
234
234
+
if (post.frontmatter.tags && post.frontmatter.tags.length > 0) {
235
235
+
record.tags = post.frontmatter.tags;
236
236
+
}
237
237
+
230
238
await agent.com.atproto.repo.putRecord({
231
239
repo: agent.session!.did,
232
240
collection: collection!,
···
254
262
publishedAt: string;
255
263
canonicalUrl?: string;
256
264
coverImage?: BlobObject;
265
265
+
tags?: string[];
257
266
location?: string;
258
267
}
259
268