fix-build

This commit is contained in:
tangly1024.com
2023-06-07 15:51:07 +08:00
parent 93fd5b8fe3
commit 81e018fe84
10 changed files with 11 additions and 11 deletions

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

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

@@ -42,7 +42,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
))}
</ul>
</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

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

@@ -42,7 +42,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
))}
</ul>
</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">
@@ -27,6 +27,6 @@ const RecommendPosts = ({ recommendPosts }) => {
))}
</ul>
</div>
);
)
}
export default RecommendPosts