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}
- {posts.map(post => (
+ {posts?.map(post => (
-
- {recommendPosts.map(post => {
+ {recommendposts?.map(post => {
const headerImage = post?.page_cover
? `url("${post.page_cover}")`
: `url("${siteInfo?.pageCover}")`
diff --git a/themes/hexo/components/BlogPostArchive.js b/themes/hexo/components/BlogPostArchive.js
index 20887d45..4a746bde 100644
--- a/themes/hexo/components/BlogPostArchive.js
+++ b/themes/hexo/components/BlogPostArchive.js
@@ -21,7 +21,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
{archiveTitle}
- {posts.map(post => (
+ {posts?.map(post => (
- {
{/* 文章列表 */}
- {posts.map(post => (
+ {posts?.map(post => (
))}
diff --git a/themes/hexo/components/LatestPostsGroup.js b/themes/hexo/components/LatestPostsGroup.js
index b7f7e558..66f8b862 100644
--- a/themes/hexo/components/LatestPostsGroup.js
+++ b/themes/hexo/components/LatestPostsGroup.js
@@ -26,7 +26,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
{locale.COMMON.LATEST_POSTS}
- {latestPosts.map(post => {
+ {latestposts?.map(post => {
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
const headerImage = post?.page_cover ? post.page_cover : siteInfo?.pageCover
diff --git a/themes/matery/components/ArticleRecommend.js b/themes/matery/components/ArticleRecommend.js
index 67620599..ed01e521 100644
--- a/themes/matery/components/ArticleRecommend.js
+++ b/themes/matery/components/ArticleRecommend.js
@@ -28,7 +28,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) {
- {recommendPosts.map(post => {
+ {recommendposts?.map(post => {
const headerImage = post?.page_cover
? `url("${post.page_cover}")`
: `url("${siteInfo?.pageCover}")`
diff --git a/themes/matery/components/BlogPostArchive.js b/themes/matery/components/BlogPostArchive.js
index 226f77eb..f90f4c03 100644
--- a/themes/matery/components/BlogPostArchive.js
+++ b/themes/matery/components/BlogPostArchive.js
@@ -21,7 +21,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
{archiveTitle}
- {posts.map(post => (
+ {posts?.map(post => (
- {
{/* 文章列表 */}
- {posts.map(post => (
+ {posts?.map(post => (
))}
diff --git a/themes/matery/components/LatestPostsGroup.js b/themes/matery/components/LatestPostsGroup.js
index cfb44018..ae0d1450 100644
--- a/themes/matery/components/LatestPostsGroup.js
+++ b/themes/matery/components/LatestPostsGroup.js
@@ -25,7 +25,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
{locale.COMMON.LATEST_POSTS}
- {latestPosts.map(post => {
+ {latestposts?.map(post => {
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
const headerImage = post?.page_cover
? `url("${post.page_cover}")`
diff --git a/themes/medium/components/BlogPostListPage.js b/themes/medium/components/BlogPostListPage.js
index bd7499dc..db74b74e 100644
--- a/themes/medium/components/BlogPostListPage.js
+++ b/themes/medium/components/BlogPostListPage.js
@@ -22,7 +22,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
{/* 文章列表 */}
- {posts.map(post => (
+ {posts?.map(post => (
))}
diff --git a/themes/next/components/BlogPostArchive.js b/themes/next/components/BlogPostArchive.js
index 91f5527a..df189138 100644
--- a/themes/next/components/BlogPostArchive.js
+++ b/themes/next/components/BlogPostArchive.js
@@ -21,7 +21,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
{archiveTitle}
- {posts.map(post => (
+ {posts?.map(post => (
- {
{/* 文章列表 */}
- {posts.map(post => (
+ {posts?.map(post => (
))}
diff --git a/themes/next/components/LatestPostsGroup.js b/themes/next/components/LatestPostsGroup.js
index a12f55b5..01018fa5 100644
--- a/themes/next/components/LatestPostsGroup.js
+++ b/themes/next/components/LatestPostsGroup.js
@@ -25,7 +25,7 @@ const LatestPostsGroup = ({ latestPosts }) => {
{locale.COMMON.LATEST_POSTS}
- {latestPosts.map(post => {
+ {latestposts?.map(post => {
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
return (
( {
{locale.COMMON.RELATE_POSTS} :
- {recommendPosts.map(post => (
+ {recommendposts?.map(post => (
-