@@ -119,7 +119,7 @@ export default function ArticleDetail(props) {
>
)}
- {post.type === 'Post' &&
}
+ {post?.type === 'Post' &&
}
>}
{/* 评论互动 */}
diff --git a/themes/nobelium/components/ArticleInfo.js b/themes/nobelium/components/ArticleInfo.js
index f66eb002..7cc873aa 100644
--- a/themes/nobelium/components/ArticleInfo.js
+++ b/themes/nobelium/components/ArticleInfo.js
@@ -34,7 +34,7 @@ export const ArticleInfo = (props) => {
{post?.publishTime}
- {post.tags && (
+ {post?.tags && (
{post?.tags.map(tag => (
diff --git a/themes/nobelium/index.js b/themes/nobelium/index.js
index f0412b92..7462d8f1 100644
--- a/themes/nobelium/index.js
+++ b/themes/nobelium/index.js
@@ -110,7 +110,7 @@ const LayoutPostList = props => {
let filteredBlogPosts = []
if (filterKey && posts) {
filteredBlogPosts = posts.filter(post => {
- const tagContent = post.tags ? post.tags.join(' ') : ''
+ const tagContent = post?.tags ? post?.tags.join(' ') : ''
const searchContent = post.title + post.summary + tagContent
return searchContent.toLowerCase().includes(filterKey.toLowerCase())
})
diff --git a/themes/plog/components/ArticleInfo.js b/themes/plog/components/ArticleInfo.js
index fc6e70fc..7cc873aa 100644
--- a/themes/plog/components/ArticleInfo.js
+++ b/themes/plog/components/ArticleInfo.js
@@ -1,5 +1,4 @@
-import formatDate from '@/lib/formatDate'
import Image from 'next/image'
import BLOG from '@/blog.config'
import TagItem from './TagItem'
@@ -33,12 +32,9 @@ export const ArticleInfo = (props) => {
/
- {formatDate(
- post?.publishTime || post?.createdTime,
- BLOG.LANG
- )}
+ {post?.publishTime}
- {post.tags && (
+ {post?.tags && (
{post?.tags.map(tag => (
diff --git a/themes/simple/components/ArticleInfo.js b/themes/simple/components/ArticleInfo.js
index 93921c7c..daee32a1 100644
--- a/themes/simple/components/ArticleInfo.js
+++ b/themes/simple/components/ArticleInfo.js
@@ -21,7 +21,7 @@ export const ArticleInfo = (props) => {
{BLOG.AUTHOR}
- {post?.publishTime}
{post?.category &&
- {post?.category}}
- {post?.tags && post.tags?.length > 0 && post?.tags.map(t =>
/ {t})}
+ {post?.tags && post?.tags?.length > 0 && post?.tags.map(t =>
/ {t})}
>)}
diff --git a/themes/simple/components/BlogItem.js b/themes/simple/components/BlogItem.js
index 8a5561c7..a60bd89e 100644
--- a/themes/simple/components/BlogItem.js
+++ b/themes/simple/components/BlogItem.js
@@ -32,7 +32,7 @@ export const BlogItem = props => {
{post.category && {post.category}}
- {post.tags && post.tags?.length > 0 && post.tags.map(t => /{t})}
+ {post?.tags && post?.tags?.length > 0 && post?.tags.map(t => /{t})}