diff --git a/components/BlogPostArchive.js b/components/BlogPostArchive.js index 15a906eb..1e235174 100644 --- a/components/BlogPostArchive.js +++ b/components/BlogPostArchive.js @@ -15,30 +15,19 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => { } else { return
{archiveTitle}
-
} } -/** - * 获取从第1页到指定页码的文章 - * @param page 第几页 - * @param totalPosts 所有文章 - * @param postsPerPage 每页文章数量 - * @returns {*} - */ -const getPostByPage = function (page, totalPosts, postsPerPage) { - return totalPosts.slice( - 0, - postsPerPage * page - ) -} export default BlogPostArchive diff --git a/components/BlogPostCard.js b/components/BlogPostCard.js index 8bb7533f..19852627 100644 --- a/components/BlogPostCard.js +++ b/components/BlogPostCard.js @@ -11,7 +11,7 @@ const BlogPostCard = ({ post, tags }) => {
-
+
1) ? post.page_cover : BLOG.defaultImgCover} alt={post.title} layout='fill' objectFit='cover' loading='lazy' />
diff --git a/components/LatestPostsGroup.js b/components/LatestPostsGroup.js index 175ec24b..3c5fd670 100644 --- a/components/LatestPostsGroup.js +++ b/components/LatestPostsGroup.js @@ -32,13 +32,13 @@ const LatestPostsGroup = ({ posts, sliceCount = 5 }) => { return (
-
{post.title}
-
+
{formatDateFmt(post.lastEditedTime, 'yyyy/MM/dd')}
diff --git a/pages/article/[slug].js b/pages/article/[slug].js index 5247b5f3..1167a0af 100644 --- a/pages/article/[slug].js +++ b/pages/article/[slug].js @@ -53,16 +53,16 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, allPosts, categories
-
- {post.type && !post.type.includes('Page') && (<> -
- 1) ? post.page_cover : BLOG.defaultImgCover} loading='eager' objectFit='cover' layout='fill' alt={post.title} /> -
- )} +
-
+
+ {post.type && !post.type.includes('Page') && (<> +
+ 1) ? post.page_cover : BLOG.defaultImgCover} loading='eager' objectFit='cover' layout='fill' alt={post.title} /> +
+ )} {/* 文章Title */} -

{post.title}

+

{post.title}


@@ -126,7 +126,7 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, allPosts, categories
-
+