From 3bb83c35576bf4d12f00e0e06eb12a6e6a4b2208 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Fri, 26 Apr 2024 09:38:53 +0800 Subject: [PATCH] =?UTF-8?q?starter=20=E9=A6=96=E9=A1=B5=E5=8D=9A=E5=AE=A2?= =?UTF-8?q?=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/starter/components/Blog.js | 117 +++++++++++++++--------------- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/themes/starter/components/Blog.js b/themes/starter/components/Blog.js index 168c2984..2dff9e82 100644 --- a/themes/starter/components/Blog.js +++ b/themes/starter/components/Blog.js @@ -1,8 +1,8 @@ /* eslint-disable @next/next/no-img-element */ import { siteConfig } from '@/lib/config' -import CONFIG from '../config' import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' import Link from 'next/link' +import CONFIG from '../config' /** * 博文列表 @@ -10,71 +10,72 @@ import Link from 'next/link' * @returns */ export const Blog = ({ posts }) => { - return <> - {/* */} -
-
- {/* 区块标题文字 */} -
-
-
- - {siteConfig('STARTER_BLOG_TITLE', null, CONFIG)} - -

- {siteConfig('STARTER_BLOG_TEXT_1', null, CONFIG)} -

-

- -

-
-
+ return ( + <> + {/* */} +
+
+ {/* 区块标题文字 */} +
+
+
+ + {siteConfig('STARTER_BLOG_TITLE', null, CONFIG)} + +

+ {siteConfig('STARTER_BLOG_TEXT_1', null, CONFIG)} +

+

+
- {/* 博客列表 此处优先展示3片文章 */} -
- {posts?.map((item, index) => { - const url = checkContainHttp(item.slug) ? sliceUrlFromHttp(item.slug) : `${siteConfig('SUB_PATH', '')}/${item.slug}` - return
-
-
- +
+ {/* 博客列表 此处优先展示3片文章 */} +
+ {posts?.map((item, index) => { + const url = checkContainHttp(item.slug) + ? sliceUrlFromHttp(item.slug) + : `${siteConfig('SUB_PATH', '')}/${item.slug}` + return ( +
+
+
+ {item.title} - +
- + {item.publishDay} - -

- - {item.title} - -

-

- {item.summary} -

-
+ +

+ + {item.title} + +

+

+ {item.summary} +

+
- }) } -
+ ) + })} +
-
- {/* */} +
+ {/* */} + ) }