From 92c0abf3207f3925631800cae9d10b166cb402bf Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Wed, 24 Apr 2024 16:59:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83matery=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/matery/components/BlogPostListPage.js | 19 +- themes/matery/components/Footer.js | 63 ++- themes/matery/components/PostHeader.js | 28 +- themes/matery/index.js | 481 ++++++++++--------- 4 files changed, 339 insertions(+), 252 deletions(-) diff --git a/themes/matery/components/BlogPostListPage.js b/themes/matery/components/BlogPostListPage.js index 7f7c4b6f..05478669 100644 --- a/themes/matery/components/BlogPostListPage.js +++ b/themes/matery/components/BlogPostListPage.js @@ -1,5 +1,5 @@ -import BlogPostCard from './BlogPostCard' import { siteConfig } from '@/lib/config' +import BlogPostCard from './BlogPostCard' import BlogPostListEmpty from './BlogPostListEmpty' import PaginationSimple from './PaginationSimple' @@ -12,7 +12,9 @@ import PaginationSimple from './PaginationSimple' * @constructor */ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => { - const totalPage = Math.ceil(postCount / parseInt(siteConfig('POSTS_PER_PAGE'))) + const totalPage = Math.ceil( + postCount / parseInt(siteConfig('POSTS_PER_PAGE')) + ) const showPagination = postCount >= parseInt(siteConfig('POSTS_PER_PAGE')) if (!posts || posts.length === 0 || page > totalPage) { return @@ -21,12 +23,17 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
{/* 文章列表 */} -
- {posts?.map(post => ( -
+
+ {posts?.map((post, index) => ( +
+ {' '} + +
))}
- {showPagination && } + {showPagination && ( + + )}
) } diff --git a/themes/matery/components/Footer.js b/themes/matery/components/Footer.js index b75368b4..a2266cbb 100644 --- a/themes/matery/components/Footer.js +++ b/themes/matery/components/Footer.js @@ -3,31 +3,60 @@ import { siteConfig } from '@/lib/config' const Footer = ({ title }) => { const d = new Date() const currentYear = d.getFullYear() - const copyrightDate = (function() { - if (Number.isInteger(siteConfig('SINCE')) && siteConfig('SINCE') < currentYear) { + const copyrightDate = (function () { + if ( + Number.isInteger(siteConfig('SINCE')) && + siteConfig('SINCE') < currentYear + ) { return siteConfig('SINCE') + '-' + currentYear } return currentYear })() return ( -