diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 4e42d349..20f47be3 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -184,7 +184,7 @@ export function getNavPages({ allPages }) { return post && post?.slug && (!post?.slug?.startsWith('http')) && post?.type === 'Post' && post?.status === 'Published' }) - return allNavPages.map(item => ({ id: item.id, title: item.title || '', pageCoverThumbnail: item.pageCoverThumbnail || '', category: item.category || null, tags: item.tags || null, summary: item.summary || null, slug: item.slug })) + return allNavPages.map(item => ({ id: item.id, title: item.title || '', pageCoverThumbnail: item.pageCoverThumbnail || '', category: item.category || null, tags: item.tags || null, summary: item.summary || null, slug: item.slug, lastEditedDate: item.lastEditedDate })) } /** diff --git a/themes/heo/components/Hero.js b/themes/heo/components/Hero.js index 4d8da6ca..b9269561 100644 --- a/themes/heo/components/Hero.js +++ b/themes/heo/components/Hero.js @@ -160,22 +160,9 @@ function TopGroup(props) { todayCardRef.current.coverUp() } - let topPosts = [] - // 默认展示最近更新 - if (!CONFIG.HERO_RECOMMEND_POST_TAG || CONFIG.HERO_RECOMMEND_POST_TAG === '') { - topPosts = latestPosts - } else { - // 展示特定标签文章 - for (const post of allNavPages) { - if (topPosts.length === 6) { - break - } - // 查找标签 - if (post?.tags?.indexOf(CONFIG.HERO_RECOMMEND_POST_TAG) >= 0) { - topPosts.push(post) - } - } - } + // 获取置顶推荐文章 + const topPosts = getTopPosts({ latestPosts, allNavPages }) + return (