-
-
+
+
+
+
+
- {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/hexo/components/BlogPostCardInfo.js b/themes/hexo/components/BlogPostCardInfo.js
index 7355bac8..e55394c1 100644
--- a/themes/hexo/components/BlogPostCardInfo.js
+++ b/themes/hexo/components/BlogPostCardInfo.js
@@ -41,15 +41,14 @@ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary
{/* 摘要 */}
{(!showPreview || showSummary) && !post.results && (
-
+
{post.summary}
)}
{/* 搜索结果 */}
{post.results && (
-
+
{post.results.map(r => (
{r}
))}
diff --git a/themes/hexo/components/MenuButtonGroupTop.js b/themes/hexo/components/MenuButtonGroupTop.js
index f6ae7a29..866898e8 100644
--- a/themes/hexo/components/MenuButtonGroupTop.js
+++ b/themes/hexo/components/MenuButtonGroupTop.js
@@ -8,6 +8,7 @@ const MenuButtonGroupTop = (props) => {
const { locale } = useGlobal()
let links = [
+ { icon: 'fa-solid fa-house', name: locale.NAV.INDEX, to: '/', show: CONFIG_HEXO.MENU_INDEX },
{ icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_HEXO.MENU_SEARCH },
{ icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_HEXO.MENU_ARCHIVE }
// { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_HEXO.MENU_CATEGORY },
@@ -36,12 +37,12 @@ const MenuButtonGroupTop = (props) => {
- );
+ )
} else {
return null
}
})}
- );
+ )
}
export default MenuButtonGroupTop
diff --git a/themes/hexo/config_hexo.js b/themes/hexo/config_hexo.js
index 3a2612fd..73febab2 100644
--- a/themes/hexo/config_hexo.js
+++ b/themes/hexo/config_hexo.js
@@ -6,6 +6,7 @@ const CONFIG_HEXO = {
HOME_NAV_BACKGROUND_IMG_FIXED: true, // 首页背景图滚动时是否固定,true 则滚动时图片不懂; false则随鼠标滚动
// 菜单配置
+ MENU_INDEX: true, // 显示首页
MENU_CATEGORY: true, // 显示分类
MENU_TAG: true, // 显示标签
MENU_ARCHIVE: true, // 显示归档
diff --git a/themes/matery/components/BlogPostCard.js b/themes/matery/components/BlogPostCard.js
index 980141eb..b3941fdc 100644
--- a/themes/matery/components/BlogPostCard.js
+++ b/themes/matery/components/BlogPostCard.js
@@ -20,10 +20,10 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
data-aos-delay={delay}
data-aos-once="true"
data-aos-anchor-placement="top-bottom"
- className="w-full mb-4 h-full overflow-auto shadow-md border dark:border-black rounded-xl bg-white dark:bg-hexo-black-gray">
+ className="w-full mb-4 overflow-auto shadow-md border dark:border-black rounded-xl bg-white dark:bg-hexo-black-gray">
{/* 固定高度 ,空白用图片拉升填充 */}
-
+
{/* 头部图片 填充卡片 */}
{showPageCover && (
@@ -36,22 +36,12 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
alt={post.title}
className="opacity-50 h-full w-full hover:scale-125 rounded-t-md transform object-cover duration-500"
/>
- {/*
-
-
*/}
-
{post.title}
+
{post.title}
)}
+ {/* 文字描述 */}
{/* 描述 */}
diff --git a/themes/matery/components/BlogPostListPage.js b/themes/matery/components/BlogPostListPage.js
index 2b716581..4a041aa7 100644
--- a/themes/matery/components/BlogPostListPage.js
+++ b/themes/matery/components/BlogPostListPage.js
@@ -21,9 +21,9 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
{/* 文章列表 */}
-
+
{posts.map(post => (
-
+
))}
{showPagination &&
}
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 => (
-
+
+
+
))}