From 43287cbf74d6514de165bddd7226e639db895af1 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 13 Jul 2023 16:54:52 +0800 Subject: [PATCH] =?UTF-8?q?heo-=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/HeroIcons.js | 6 + lib/notion/getNotionData.js | 2 +- themes/heo/components/AnalyticsCard.js | 50 ++++---- themes/heo/components/BlogPostCard.js | 8 +- themes/heo/components/BlogPostListPage.js | 2 +- themes/heo/components/Header.js | 2 +- themes/heo/components/Hero.js | 137 ++++++++++++++++----- themes/heo/components/InfoCard.js | 23 +++- themes/heo/components/Logo.js | 23 ++-- themes/heo/components/NoticeBar.js | 18 +++ themes/heo/components/SideRight.js | 2 + themes/heo/config.js | 12 +- themes/heo/index.js | 143 ++++++++++++++-------- themes/heo/style.js | 5 + 14 files changed, 306 insertions(+), 127 deletions(-) create mode 100644 themes/heo/components/NoticeBar.js diff --git a/components/HeroIcons.js b/components/HeroIcons.js index c9cbcce2..f40fdfc3 100644 --- a/components/HeroIcons.js +++ b/components/HeroIcons.js @@ -74,3 +74,9 @@ export const ArrowRightCircle = ({ className }) => { } + +export const PlusSmall = ({ className }) => { + return + + +} diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 89126d9c..fb6bc942 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -309,7 +309,7 @@ async function getDataBaseInfoByNotionAPI({ pageId, from }) { const customNav = getCustomNav({ allPages: collectionData.filter(post => post?.type === 'Page' && post.status === 'Published') }) // 新的菜单 const customMenu = await getCustomMenu({ collectionData }) - const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 5 }) + const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 6 }) const allNavPages = getNavPages({ allPages }) return { diff --git a/themes/heo/components/AnalyticsCard.js b/themes/heo/components/AnalyticsCard.js index 0ee1e1cd..9732fcd4 100644 --- a/themes/heo/components/AnalyticsCard.js +++ b/themes/heo/components/AnalyticsCard.js @@ -1,30 +1,28 @@ -import Card from './Card' - -export function AnalyticsCard (props) { +export function AnalyticsCard(props) { const { postCount } = props - return -
- 统计 -
-
-
-
-
文章数:
-
{postCount}
+ return <> +
+ 统计
-
-
-
-
访问量:
-
+
+
+
+
文章数:
+
{postCount}
+
+
+
+
+
访问量:
+
+
+
+
+
+
访客数:
+
+
+
-
-
-
-
访客数:
-
-
-
-
- + } diff --git a/themes/heo/components/BlogPostCard.js b/themes/heo/components/BlogPostCard.js index 43be9051..142a54fc 100644 --- a/themes/heo/components/BlogPostCard.js +++ b/themes/heo/components/BlogPostCard.js @@ -1,5 +1,4 @@ import Link from 'next/link' -import React, { useState } from 'react' import CONFIG from '../config' import BLOG from '@/blog.config' import TagItemMini from './TagItemMini' @@ -7,20 +6,19 @@ import TagItemMini from './TagItemMini' const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { const showPreview = CONFIG.POST_LIST_PREVIEW && post.blockMap - const [onHover, setOnHover] = useState(false) if (post && !post.pageCoverThumbnail && CONFIG.POST_LIST_COVER_DEFAULT) { post.pageCoverThumbnail = siteInfo?.pageCover } const showPageCover = CONFIG.POST_LIST_COVER && post?.pageCoverThumbnail && !showPreview return (
-
setOnHover(true)} onMouseLeave={() => setOnHover(false)} className={'w-full hover:border-indigo-600 duration-300 transition-colors border justify-between flex flex-col lg:h-96 overflow-hidden rounded-xl bg-white '}> +
{/* 图片封面 */} {showPageCover && (
-
+
)} @@ -41,7 +39,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { + className={' group-hover:text-indigo-700 group-hover:dark:text-indigo-400 text-black dark:text-gray-100 line-clamp-2 replace cursor-pointer text-2xl font-extrabold leading-tight'}> {post.title} diff --git a/themes/heo/components/BlogPostListPage.js b/themes/heo/components/BlogPostListPage.js index bf4fa625..c2ec5869 100644 --- a/themes/heo/components/BlogPostListPage.js +++ b/themes/heo/components/BlogPostListPage.js @@ -20,7 +20,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => { return (
{/* 文章列表 */} -
+
{posts?.map(post => ( ))} diff --git a/themes/heo/components/Header.js b/themes/heo/components/Header.js index 4056da31..81c3ee0e 100644 --- a/themes/heo/components/Header.js +++ b/themes/heo/components/Header.js @@ -45,7 +45,7 @@ const Header = props => { return (<> {/* 头条 */}