A CLI for publishing standard.site documents to ATProto

fix: add a initial date

+8 -1
+7 -1
packages/cli/src/commands/publish.ts
··· 234 } 235 } 236 237 - log.message(` ${icon} ${post.frontmatter.title} (${reason})${bskyNote}`); 238 } 239 240 if (dryRun) { ··· 280 281 for (const { post, action } of postsToPublish) { 282 s.start(`Publishing: ${post.frontmatter.title}`); 283 284 try { 285 // Handle cover image upload
··· 234 } 235 } 236 237 + log.message(` ${icon} ${post.filePath} (${reason})${bskyNote}`); 238 } 239 240 if (dryRun) { ··· 280 281 for (const { post, action } of postsToPublish) { 282 s.start(`Publishing: ${post.frontmatter.title}`); 283 + 284 + // Init publish date 285 + if (!post.frontmatter.publishDate) { 286 + const [publishDate] = new Date().toISOString().split("T") 287 + post.frontmatter.publishDate = publishDate! 288 + } 289 290 try { 291 // Handle cover image upload
+1
packages/cli/src/lib/atproto.ts
··· 299 300 const pathPrefix = config.pathPrefix || "/posts"; 301 const postPath = `${pathPrefix}/${post.slug}`; 302 const publishDate = new Date(post.frontmatter.publishDate); 303 const textContent = getTextContent(post, config.textContentField); 304
··· 299 300 const pathPrefix = config.pathPrefix || "/posts"; 301 const postPath = `${pathPrefix}/${post.slug}`; 302 + 303 const publishDate = new Date(post.frontmatter.publishDate); 304 const textContent = getTextContent(post, config.textContentField); 305