fix/ build

This commit is contained in:
tangly1024.com
2023-06-07 15:47:31 +08:00
parent d98d1f4c4b
commit 93fd5b8fe3
17 changed files with 17 additions and 17 deletions

View File

@@ -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)

View File

@@ -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 => {

View File

@@ -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 => {

View File

@@ -21,7 +21,7 @@ const BlogArchiveItem = ({ posts = [], archiveTitle }) => {
{archiveTitle}
</div>
<ul>
{posts.map(post => (
{posts?.map(post => (
<li
key={post.id}
className="border-l-2 p-1 text-xs md:text-base items-center hover:scale-x-105 hover:border-gray-500 dark:hover:border-gray-300 dark:border-gray-400 transform duration-500"

View File

@@ -28,7 +28,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) {
</div>
</div>
<div className="grid grid-cols-2 md:grid-cols-3 gap-4">
{recommendPosts.map(post => {
{recommendposts?.map(post => {
const headerImage = post?.page_cover
? `url("${post.page_cover}")`
: `url("${siteInfo?.pageCover}")`

View File

@@ -21,7 +21,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
{archiveTitle}
</div>
<ul>
{posts.map(post => (
{posts?.map(post => (
<li
key={post.id}
className="border-l-2 p-1 text-xs md:text-base items-center hover:scale-x-105 hover:border-indigo-500 dark:hover:border-indigo-300 dark:border-indigo-400 transform duration-500"

View File

@@ -21,7 +21,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
<div id="container" className='w-full'>
{/* 文章列表 */}
<div className="space-y-6 px-2">
{posts.map(post => (
{posts?.map(post => (
<BlogPostCard index={posts.indexOf(post)} key={post.id} post={post} siteInfo={siteInfo}/>
))}
</div>

View File

@@ -26,7 +26,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
{locale.COMMON.LATEST_POSTS}
</div>
</div>
{latestPosts.map(post => {
{latestposts?.map(post => {
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
const headerImage = post?.page_cover ? post.page_cover : siteInfo?.pageCover

View File

@@ -28,7 +28,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) {
</div>
</div>
<div className="grid grid-cols-2 md:grid-cols-3 gap-4">
{recommendPosts.map(post => {
{recommendposts?.map(post => {
const headerImage = post?.page_cover
? `url("${post.page_cover}")`
: `url("${siteInfo?.pageCover}")`

View File

@@ -21,7 +21,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
{archiveTitle}
</div>
<ul>
{posts.map(post => (
{posts?.map(post => (
<li
key={post.id}
className="border-l-2 p-1 text-xs md:text-base items-center hover:scale-x-105 hover:border-indigo-500 dark:hover:border-indigo-300 dark:border-indigo-400 transform duration-500"

View File

@@ -22,7 +22,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
<div className='pt-6'></div>
{/* 文章列表 */}
<div className="pt-4 flex flex-wrap pb-12" >
{posts.map(post => (
{posts?.map(post => (
<div key={post.id} className='xl:w-1/3 md:w-1/2 w-full p-4'> <BlogPostCard index={posts.indexOf(post)} post={post} siteInfo={siteInfo} /></div>
))}
</div>

View File

@@ -25,7 +25,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
{locale.COMMON.LATEST_POSTS}
</div>
</div>
{latestPosts.map(post => {
{latestposts?.map(post => {
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
const headerImage = post?.page_cover
? `url("${post.page_cover}")`

View File

@@ -22,7 +22,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
<div className='w-full justify-center'>
<div id='container'>
{/* 文章列表 */}
{posts.map(post => (
{posts?.map(post => (
<BlogPostCard key={post.id} post={post} />
))}
</div>

View File

@@ -21,7 +21,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
{archiveTitle}
</div>
<ul>
{posts.map(post => (
{posts?.map(post => (
<li
key={post.id}
className="border-l-2 p-1 text-xs md:text-base items-center hover:scale-x-105 hover:border-gray-500 dark:hover:border-gray-300 dark:border-gray-400 transform duration-500"

View File

@@ -21,7 +21,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
<div>
{/* 文章列表 */}
<div id="container" className="flex flex-wrap lg:space-y-4 space-y-1">
{posts.map(post => (
{posts?.map(post => (
<BlogPostCard key={post.id} post={post} />
))}
</div>

View File

@@ -25,7 +25,7 @@ const LatestPostsGroup = ({ latestPosts }) => {
{locale.COMMON.LATEST_POSTS}
</div>
</div>
{latestPosts.map(post => {
{latestposts?.map(post => {
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
return (
(<Link

View File

@@ -16,7 +16,7 @@ const RecommendPosts = ({ recommendPosts }) => {
<div className="pt-2 border pl-4 py-2 my-4 dark:text-gray-300 ">
<div className="mb-2 font-bold text-lg">{locale.COMMON.RELATE_POSTS} :</div>
<ul className="font-light text-sm">
{recommendPosts.map(post => (
{recommendposts?.map(post => (
<li className="py-1" key={post.id}>
<Link href={`/${post.slug}`} className="cursor-pointer hover:underline">