diff --git a/scripts/new-post.js b/scripts/new-post.js index 253139020..187bfd0e7 100644 --- a/scripts/new-post.js +++ b/scripts/new-post.js @@ -8,8 +8,11 @@ function getDate() { const year = today.getFullYear() const month = String(today.getMonth() + 1).padStart(2, "0") const day = String(today.getDate()).padStart(2, "0") + const hours = String(today.getHours()).padStart(2, "0") + const minutes = String(today.getMinutes()).padStart(2, "0") + const seconds = String(today.getSeconds()).padStart(2, "0") - return `${year}-${month}-${day}` + return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}` } const args = process.argv.slice(2) diff --git a/src/content/posts/netlify-oss.md b/src/content/posts/netlify-oss.md index c22d6b001..7da7de6f7 100644 --- a/src/content/posts/netlify-oss.md +++ b/src/content/posts/netlify-oss.md @@ -1,6 +1,6 @@ --- title: 有自己的开源项目?来申请Netlify的Open Source计划! -published: 2025-08-09 +published: 2025-08-09T00:00:01 description: '昨天在乱翻Netlify的网站,突然发现了一个开源计划的申请入口,故申请,没想到今天就通过了😋' image: '../assets/images/2025-08-09-05-14-11-image.png' tags: [Netlify] diff --git a/src/content/posts/netlify-webhook.md b/src/content/posts/netlify-webhook.md index afa6a2d41..c6909251f 100644 --- a/src/content/posts/netlify-webhook.md +++ b/src/content/posts/netlify-webhook.md @@ -1,6 +1,6 @@ --- title: 利用Netlify WebHook来实时提醒你的订阅者博客文章更新 -published: 2025-08-09 +published: 2025-08-09T00:01:00 description: '早期提过使用Github WebHook来做到这件事,今天偶然发现了Netlify也可以做到同样的事情' image: '../assets/images/2025-08-09-23-03-37-image.png' tags: [Netlify] diff --git a/src/utils/content-utils.ts b/src/utils/content-utils.ts index 2964ede24..ddb904dac 100644 --- a/src/utils/content-utils.ts +++ b/src/utils/content-utils.ts @@ -11,7 +11,7 @@ export async function getSortedPosts() { if (a.data.pinned !== b.data.pinned) { return a.data.pinned ? -1 : 1; } - // 都是置顶或都不是置顶,按发布日期排序 + // 都是置顶或都不是置顶,按发布日期时间排序(包含小时分钟秒) const dateA = new Date(a.data.published); const dateB = new Date(b.data.published); return dateA > dateB ? -1 : 1;