diff --git a/themes/fukasawa/components/ArticleDetail.js b/themes/fukasawa/components/ArticleDetail.js index 37bc86c5..1ea23429 100644 --- a/themes/fukasawa/components/ArticleDetail.js +++ b/themes/fukasawa/components/ArticleDetail.js @@ -96,7 +96,7 @@ export default function ArticleDetail(props) { - {post.type === 'Post' && } + {post?.type === 'Post' && } {/* 评论互动 */}
diff --git a/themes/hexo/index.js b/themes/hexo/index.js index 3e1d6846..dd4e8aa5 100644 --- a/themes/hexo/index.js +++ b/themes/hexo/index.js @@ -227,7 +227,7 @@ const LayoutSlug = props => { {/* 分享 */} - {post.type === 'Post' && <> + {post?.type === 'Post' && <> diff --git a/themes/medium/components/BlogPostListScroll.js b/themes/medium/components/BlogPostListScroll.js index 59a6bd07..0ed06ae3 100644 --- a/themes/medium/components/BlogPostListScroll.js +++ b/themes/medium/components/BlogPostListScroll.js @@ -20,7 +20,7 @@ const BlogPostListScroll = ({ posts = [], currentSearch }) => { const searchKey = getSearchKey() if (searchKey) { filteredPosts = 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(searchKey.toLowerCase()) }) diff --git a/themes/medium/index.js b/themes/medium/index.js index fd102bf1..a0884129 100644 --- a/themes/medium/index.js +++ b/themes/medium/index.js @@ -174,7 +174,7 @@ const LayoutSlug = props => {
{/* 上一篇下一篇文章 */} - {post.type === 'Post' && } + {post?.type === 'Post' && } {/* 评论区 */} diff --git a/themes/next/components/ArticleDetail.js b/themes/next/components/ArticleDetail.js index b8fa6c6c..fab84eeb 100644 --- a/themes/next/components/ArticleDetail.js +++ b/themes/next/components/ArticleDetail.js @@ -87,10 +87,10 @@ export default function ArticleDetail(props) { {/* 版权声明 */} - {post.type === 'Post' && } + {post?.type === 'Post' && } {/* 推荐文章 */} - {post.type === 'Post' && } + {post?.type === 'Post' && }
{/* 分类 */} @@ -104,7 +104,7 @@ export default function ArticleDetail(props) { } {/* 标签列表 */} - {post.type === 'Post' && ( + {post?.type === 'Post' && ( <> {post.tagItems && (
@@ -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})}