mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-05 07:26:46 +00:00
fix/ build
This commit is contained in:
@@ -24,7 +24,7 @@ const TwikooCommentCounter = (props) => {
|
|||||||
twikoo.getCommentsCount({
|
twikoo.getCommentsCount({
|
||||||
envId: BLOG.COMMENT_TWIKOO_ENV_ID, // 环境 ID
|
envId: BLOG.COMMENT_TWIKOO_ENV_ID, // 环境 ID
|
||||||
// region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,如果您的环境地域不是上海,需传此参数
|
// region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,如果您的环境地域不是上海,需传此参数
|
||||||
urls: posts.map(post => post.slug), // 不包含协议、域名、参数的文章路径列表,必传参数
|
urls: posts?.map(post => post.slug), // 不包含协议、域名、参数的文章路径列表,必传参数
|
||||||
includeReply: true // 评论数是否包括回复,默认:false
|
includeReply: true // 评论数是否包括回复,默认:false
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
// console.log('查询', res)
|
// console.log('查询', res)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export function getAllCategories({ allPages, categoryOptions, sliceCount = 0 })
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
// 计数
|
// 计数
|
||||||
let categories = allPosts.map(p => p.category)
|
let categories = allposts?.map(p => p.category)
|
||||||
categories = [...categories.flat()]
|
categories = [...categories.flat()]
|
||||||
const categoryObj = {}
|
const categoryObj = {}
|
||||||
categories.forEach(category => {
|
categories.forEach(category => {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export function getAllTags({ allPages, sliceCount = 0, tagOptions }) {
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
// 计数
|
// 计数
|
||||||
let tags = allPosts.map(p => p.tags)
|
let tags = allposts?.map(p => p.tags)
|
||||||
tags = [...tags.flat()]
|
tags = [...tags.flat()]
|
||||||
const tagObj = {}
|
const tagObj = {}
|
||||||
tags.forEach(tag => {
|
tags.forEach(tag => {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const BlogArchiveItem = ({ posts = [], archiveTitle }) => {
|
|||||||
{archiveTitle}
|
{archiveTitle}
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
{posts.map(post => (
|
{posts?.map(post => (
|
||||||
<li
|
<li
|
||||||
key={post.id}
|
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"
|
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"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-2 md:grid-cols-3 gap-4">
|
<div className="grid grid-cols-2 md:grid-cols-3 gap-4">
|
||||||
{recommendPosts.map(post => {
|
{recommendposts?.map(post => {
|
||||||
const headerImage = post?.page_cover
|
const headerImage = post?.page_cover
|
||||||
? `url("${post.page_cover}")`
|
? `url("${post.page_cover}")`
|
||||||
: `url("${siteInfo?.pageCover}")`
|
: `url("${siteInfo?.pageCover}")`
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
|
|||||||
{archiveTitle}
|
{archiveTitle}
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
{posts.map(post => (
|
{posts?.map(post => (
|
||||||
<li
|
<li
|
||||||
key={post.id}
|
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"
|
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"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
|
|||||||
<div id="container" className='w-full'>
|
<div id="container" className='w-full'>
|
||||||
{/* 文章列表 */}
|
{/* 文章列表 */}
|
||||||
<div className="space-y-6 px-2">
|
<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}/>
|
<BlogPostCard index={posts.indexOf(post)} key={post.id} post={post} siteInfo={siteInfo}/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
|
|||||||
{locale.COMMON.LATEST_POSTS}
|
{locale.COMMON.LATEST_POSTS}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{latestPosts.map(post => {
|
{latestposts?.map(post => {
|
||||||
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
|
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
|
||||||
|
|
||||||
const headerImage = post?.page_cover ? post.page_cover : siteInfo?.pageCover
|
const headerImage = post?.page_cover ? post.page_cover : siteInfo?.pageCover
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-2 md:grid-cols-3 gap-4">
|
<div className="grid grid-cols-2 md:grid-cols-3 gap-4">
|
||||||
{recommendPosts.map(post => {
|
{recommendposts?.map(post => {
|
||||||
const headerImage = post?.page_cover
|
const headerImage = post?.page_cover
|
||||||
? `url("${post.page_cover}")`
|
? `url("${post.page_cover}")`
|
||||||
: `url("${siteInfo?.pageCover}")`
|
: `url("${siteInfo?.pageCover}")`
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
|
|||||||
{archiveTitle}
|
{archiveTitle}
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
{posts.map(post => (
|
{posts?.map(post => (
|
||||||
<li
|
<li
|
||||||
key={post.id}
|
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"
|
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"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
|
|||||||
<div className='pt-6'></div>
|
<div className='pt-6'></div>
|
||||||
{/* 文章列表 */}
|
{/* 文章列表 */}
|
||||||
<div className="pt-4 flex flex-wrap pb-12" >
|
<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 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>
|
</div>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
|
|||||||
{locale.COMMON.LATEST_POSTS}
|
{locale.COMMON.LATEST_POSTS}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{latestPosts.map(post => {
|
{latestposts?.map(post => {
|
||||||
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
|
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
|
||||||
const headerImage = post?.page_cover
|
const headerImage = post?.page_cover
|
||||||
? `url("${post.page_cover}")`
|
? `url("${post.page_cover}")`
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
|
|||||||
<div className='w-full justify-center'>
|
<div className='w-full justify-center'>
|
||||||
<div id='container'>
|
<div id='container'>
|
||||||
{/* 文章列表 */}
|
{/* 文章列表 */}
|
||||||
{posts.map(post => (
|
{posts?.map(post => (
|
||||||
<BlogPostCard key={post.id} post={post} />
|
<BlogPostCard key={post.id} post={post} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
|
|||||||
{archiveTitle}
|
{archiveTitle}
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
{posts.map(post => (
|
{posts?.map(post => (
|
||||||
<li
|
<li
|
||||||
key={post.id}
|
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"
|
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"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
|
|||||||
<div>
|
<div>
|
||||||
{/* 文章列表 */}
|
{/* 文章列表 */}
|
||||||
<div id="container" className="flex flex-wrap lg:space-y-4 space-y-1">
|
<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} />
|
<BlogPostCard key={post.id} post={post} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const LatestPostsGroup = ({ latestPosts }) => {
|
|||||||
{locale.COMMON.LATEST_POSTS}
|
{locale.COMMON.LATEST_POSTS}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{latestPosts.map(post => {
|
{latestposts?.map(post => {
|
||||||
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
|
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
|
||||||
return (
|
return (
|
||||||
(<Link
|
(<Link
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const RecommendPosts = ({ recommendPosts }) => {
|
|||||||
<div className="pt-2 border pl-4 py-2 my-4 dark:text-gray-300 ">
|
<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>
|
<div className="mb-2 font-bold text-lg">{locale.COMMON.RELATE_POSTS} :</div>
|
||||||
<ul className="font-light text-sm">
|
<ul className="font-light text-sm">
|
||||||
{recommendPosts.map(post => (
|
{recommendposts?.map(post => (
|
||||||
<li className="py-1" key={post.id}>
|
<li className="py-1" key={post.id}>
|
||||||
<Link href={`/${post.slug}`} className="cursor-pointer hover:underline">
|
<Link href={`/${post.slug}`} className="cursor-pointer hover:underline">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user