From 93fd5b8fe36281b735469a0c470da6829233e8ce Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Wed, 7 Jun 2023 15:47:31 +0800 Subject: [PATCH] fix/ build --- components/TwikooCommentCounter.js | 2 +- lib/notion/getAllCategories.js | 2 +- lib/notion/getAllTags.js | 2 +- themes/fukasawa/components/BlogPostArchive.js | 2 +- themes/hexo/components/ArticleRecommend.js | 2 +- themes/hexo/components/BlogPostArchive.js | 2 +- themes/hexo/components/BlogPostListPage.js | 2 +- themes/hexo/components/LatestPostsGroup.js | 2 +- themes/matery/components/ArticleRecommend.js | 2 +- themes/matery/components/BlogPostArchive.js | 2 +- themes/matery/components/BlogPostListPage.js | 2 +- themes/matery/components/LatestPostsGroup.js | 2 +- themes/medium/components/BlogPostListPage.js | 2 +- themes/next/components/BlogPostArchive.js | 2 +- themes/next/components/BlogPostListPage.js | 2 +- themes/next/components/LatestPostsGroup.js | 2 +- themes/next/components/RecommendPosts.js | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/components/TwikooCommentCounter.js b/components/TwikooCommentCounter.js index 9688d005..b3b54ca3 100644 --- a/components/TwikooCommentCounter.js +++ b/components/TwikooCommentCounter.js @@ -24,7 +24,7 @@ const TwikooCommentCounter = (props) => { twikoo.getCommentsCount({ envId: BLOG.COMMENT_TWIKOO_ENV_ID, // 环境 ID // region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,如果您的环境地域不是上海,需传此参数 - urls: posts.map(post => post.slug), // 不包含协议、域名、参数的文章路径列表,必传参数 + urls: posts?.map(post => post.slug), // 不包含协议、域名、参数的文章路径列表,必传参数 includeReply: true // 评论数是否包括回复,默认:false }).then(function (res) { // console.log('查询', res) diff --git a/lib/notion/getAllCategories.js b/lib/notion/getAllCategories.js index b7700bc1..fd26b9b1 100644 --- a/lib/notion/getAllCategories.js +++ b/lib/notion/getAllCategories.js @@ -19,7 +19,7 @@ export function getAllCategories({ allPages, categoryOptions, sliceCount = 0 }) return [] } // 计数 - let categories = allPosts.map(p => p.category) + let categories = allposts?.map(p => p.category) categories = [...categories.flat()] const categoryObj = {} categories.forEach(category => { diff --git a/lib/notion/getAllTags.js b/lib/notion/getAllTags.js index b9144be8..94e21214 100644 --- a/lib/notion/getAllTags.js +++ b/lib/notion/getAllTags.js @@ -14,7 +14,7 @@ export function getAllTags({ allPages, sliceCount = 0, tagOptions }) { return [] } // 计数 - let tags = allPosts.map(p => p.tags) + let tags = allposts?.map(p => p.tags) tags = [...tags.flat()] const tagObj = {} tags.forEach(tag => { diff --git a/themes/fukasawa/components/BlogPostArchive.js b/themes/fukasawa/components/BlogPostArchive.js index c594d7d1..a86210db 100644 --- a/themes/fukasawa/components/BlogPostArchive.js +++ b/themes/fukasawa/components/BlogPostArchive.js @@ -21,7 +21,7 @@ const BlogArchiveItem = ({ posts = [], archiveTitle }) => { {archiveTitle}