部分配置支持环境变量

This commit is contained in:
tangly1024
2022-01-19 15:06:33 +08:00
parent f1590f52e8
commit f4f85ff1ed
10 changed files with 93 additions and 120 deletions

View File

@@ -60,7 +60,7 @@ export async function getAllPosts ({ notionPageData, from, includePage = false }
})
// Sort by date
if (BLOG.POSTS_SORT_BY_DATE) {
if (BLOG.POSTS_SORT_BY === 'date') {
posts.sort((a, b) => {
const dateA = new Date(a?.date?.start_date || a.createdTime)
const dateB = new Date(b?.date?.start_date || b.createdTime)