-
-
+
+
+
+
+
- {post.title}
+ {post.title}
-
+
- {(!showPreview || showSummary) && (
-
- {post.summary}
-
- )}
-
-
- {showPageCover && (
-
-
- {/* eslint-disable-next-line @next/next/no-img-element */}
-

- {/*
*/}
+ {(!showPreview || showSummary) && (
+
+ {post.summary}
+
+ )}
-
- )}
-
-
+
+ {showPageCover && (
+
+
+ {/* eslint-disable-next-line @next/next/no-img-element */}
+

+ {/*
*/}
+
+
+ )}
+
+
+
+
)
}
diff --git a/themes/fukasawa/components/BlogListPage.js b/themes/fukasawa/components/BlogListPage.js
index 2f0af0df..c919ef94 100644
--- a/themes/fukasawa/components/BlogListPage.js
+++ b/themes/fukasawa/components/BlogListPage.js
@@ -1,5 +1,4 @@
import BLOG from '@/blog.config'
-import { useEffect, useState } from 'react'
import BlogCard from './BlogCard'
import BlogPostListEmpty from './BlogListEmpty'
import PaginationSimple from './PaginationSimple'
@@ -15,25 +14,6 @@ import PaginationSimple from './PaginationSimple'
const BlogListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
const totalPage = Math.ceil(postCount / BLOG.POSTS_PER_PAGE)
const showNext = page < totalPage
- const [colCount, changeCol] = useState(1)
-
- function updateCol() {
- if (window.outerWidth > 1200) {
- changeCol(3)
- } else if (window.outerWidth > 900) {
- changeCol(2)
- } else {
- changeCol(1)
- }
- }
-
- useEffect(() => {
- updateCol()
- window.addEventListener('resize', updateCol)
- return () => {
- window.removeEventListener('resize', updateCol)
- }
- })
if (!posts || posts.length === 0) {
return
@@ -41,10 +21,10 @@ const BlogListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
return (
{/* 文章列表 */}
-
+
{posts?.map(post => (
-
diff --git a/themes/fukasawa/components/BlogListScroll.js b/themes/fukasawa/components/BlogListScroll.js
index b6ec891c..fad59cec 100644
--- a/themes/fukasawa/components/BlogListScroll.js
+++ b/themes/fukasawa/components/BlogListScroll.js
@@ -14,18 +14,7 @@ import { useGlobal } from '@/lib/global'
*/
const BlogListScroll = props => {
const { posts = [], siteInfo } = props
- const [colCount, changeCol] = React.useState(1)
const { locale } = useGlobal()
-
- function updateCol() {
- if (window.outerWidth > 1200) {
- changeCol(3)
- } else if (window.outerWidth > 900) {
- changeCol(2)
- } else {
- changeCol(1)
- }
- }
const targetRef = React.useRef(null)
const [page, updatePage] = React.useState(1)
@@ -56,29 +45,23 @@ const BlogListScroll = props => {
}
React.useEffect(() => {
- updateCol()
window.addEventListener('scroll', scrollTrigger)
-
- window.addEventListener('resize', updateCol)
return () => {
- window.removeEventListener('resize', updateCol)
window.removeEventListener('scroll', scrollTrigger)
}
- })
+ }, [])
if (!posts || posts.length === 0) {
return
} else {
return (
-
+
{/* 文章列表 */}
-
{postsToShow?.map(post => (
-
diff --git a/themes/fukasawa/components/Card.js b/themes/fukasawa/components/Card.js
index a330210d..e88dee68 100644
--- a/themes/fukasawa/components/Card.js
+++ b/themes/fukasawa/components/Card.js
@@ -1,10 +1,5 @@
const Card = ({ children, headerSlot, className }) => {
- return
+ return
<>{headerSlot}>
{children}
diff --git a/themes/matery/components/BlogPostListScroll.js b/themes/matery/components/BlogPostListScroll.js
index 33c5b577..fb4da657 100644
--- a/themes/matery/components/BlogPostListScroll.js
+++ b/themes/matery/components/BlogPostListScroll.js
@@ -57,9 +57,11 @@ const BlogPostListScroll = ({ posts = [], currentSearch, showSummary = CONFIG_MA
return
{/* 文章列表 */}
-
+
{postsToShow.map(post => (
-
+
+
+
))}