最新文章过滤

This commit is contained in:
tangly
2022-11-08 12:47:28 +08:00
parent 3d2ebb5b94
commit 8b5ecdb35f

View File

@@ -42,7 +42,7 @@ export async function getGlobalNotionData({
* @returns
*/
function getLatestPosts({ allPages, from, latestPostCount }) {
const allPosts = allPages.filter(page => page.type === 'Post')
const allPosts = allPages.filter(page => page.type === 'Post' && page.status === 'Published')
const latestPosts = Object.create(allPosts).sort((a, b) => {
const dateA = new Date(a?.lastEditedTime || a?.createdTime || a?.date?.start_date)