From 2cd7f13f027fa7148054f49f6ffa776a730e0bf9 Mon Sep 17 00:00:00 2001 From: JonasTech0 Date: Thu, 12 Sep 2024 09:57:27 +0800 Subject: [PATCH 1/5] =?UTF-8?q?heo=E5=B0=81=E9=9D=A2=E5=B1=85=E4=B8=AD=20?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=E8=B0=83=E6=95=B4=20=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E6=A0=87=E9=A2=98=E5=A4=84NotionIcon?= =?UTF-8?q?=E4=BD=BF=E5=85=B6=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/NotionIcon.js | 10 +++-- themes/heo/components/BlogPostCard.js | 13 ++++--- themes/heo/config.js | 54 ++++++++++++++------------- 3 files changed, 42 insertions(+), 35 deletions(-) diff --git a/components/NotionIcon.js b/components/NotionIcon.js index e60b064008e..832fc722167 100644 --- a/components/NotionIcon.js +++ b/components/NotionIcon.js @@ -5,16 +5,18 @@ import LazyImage from './LazyImage' * 可能是emoji 可能是 svg 也可能是 图片 * @returns */ -const NotionIcon = ({ icon }) => { +const NotionIcon = ({ icon, className = 'w-8 h-8 my-auto inline mr-1' }) => { if (!icon) { return <> } if (icon.startsWith('http') || icon.startsWith('data:')) { - return + // 这里优先使用传入的 className + return } - return {icon} + // 对于 emoji 或 svg,设置默认 className,也可以传递不同的样式 + return {icon} } -export default NotionIcon +export default NotionIcon \ No newline at end of file diff --git a/themes/heo/components/BlogPostCard.js b/themes/heo/components/BlogPostCard.js index b954241a435..3f1921a0022 100644 --- a/themes/heo/components/BlogPostCard.js +++ b/themes/heo/components/BlogPostCard.js @@ -29,7 +29,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { return (
+ className={` ${COVER_HOVER_ENLARGE} ? ' hover:transition-all duration-150' : ''}`}>
{ priority={index === 0} src={post?.pageCoverThumbnail} alt={post?.title} - className='h-60 w-full object-cover group-hover:scale-105 group-hover:brightness-75 transition-all duration-300' + className='h-full w-full object-cover group-hover:scale-105 group-hover:brightness-75 transition-all duration-500 ease-in-out' //宽高都调整为自适应,保证封面居中 />
@@ -74,7 +74,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { )} - {/* 标题 */} + {/* 标题和图标 */} { ' group-hover:text-indigo-700 dark:hover:text-yellow-700 dark:group-hover:text-yellow-600 text-black dark:text-gray-100 line-clamp-2 replace cursor-pointer text-xl font-extrabold leading-tight' }> {siteConfig('POST_TITLE_ICON') && ( - + )} {post.title} @@ -109,4 +112,4 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { ) } -export default BlogPostCard +export default BlogPostCard \ No newline at end of file diff --git a/themes/heo/config.js b/themes/heo/config.js index 436ad33daa6..ad3d6a114ed 100644 --- a/themes/heo/config.js +++ b/themes/heo/config.js @@ -4,12 +4,13 @@ const CONFIG = { HEO_HOME_BANNER_ENABLE: true, - HEO_SITE_CREATE_TIME: '2021-09-21', // 建站日期,用于计算网站运行的第几天 + HEO_SITE_CREATE_TIME: '2023-02-21', // 建站日期,用于计算网站运行的第几天 // 首页顶部通知条滚动内容,如不需要可以留空 [] HEO_NOTICE_BAR: [ - { title: '欢迎来到我的博客', url: 'https://blog.tangly1024.com' }, - { title: '访问文档中心获取更多帮助', url: 'https://docs.tangly1024.com' } + { title: '👏欢迎来到我的博客', url: 'https://nav.laogou717.com' }, + { title: '🔥访问导航网站,获取更多免费AI工具', url: 'https://nav.laogou717.com' }, + { title: ' 🔱 🐹 🫵 我来助你!', url: 'https://nav.laogou717.com' } ], // 英雄区左右侧组件颠倒位置 @@ -18,17 +19,17 @@ const CONFIG = { HEO_HERO_BODY_REVERSE: false, // 英雄区(首页顶部大卡) - HEO_HERO_TITLE_1: '分享编程', - HEO_HERO_TITLE_2: '与思维认知', - HEO_HERO_TITLE_3: 'TANGLY1024.COM', - HEO_HERO_TITLE_4: '新版上线', - HEO_HERO_TITLE_5: 'NotionNext4.0 轻松定制主题', - HEO_HERO_TITLE_LINK: 'https://tangly1024.com', + HEO_HERO_TITLE_1: '热爱生活', + HEO_HERO_TITLE_2: '无限进步', + HEO_HERO_TITLE_3: '神烦老狗', + HEO_HERO_TITLE_4: '我们的目标是', + HEO_HERO_TITLE_5: '星辰大海', + HEO_HERO_TITLE_LINK: 'https://www.laogou666.com', // 英雄区显示三个置顶分类 - HEO_HERO_CATEGORY_1: { title: '必看精选', url: '/tag/必看精选' }, + HEO_HERO_CATEGORY_1: { title: '干货精选', url: '/tag/干货精选' }, HEO_HERO_CATEGORY_2: { title: '热门文章', url: '/tag/热门文章' }, - HEO_HERO_CATEGORY_3: { title: '实用教程', url: '/tag/实用教程' }, + HEO_HERO_CATEGORY_3: { title: '狂人日记', url: '/tag/狂人日记' }, // 英雄区右侧推荐文章标签, 例如 [推荐] , 最多六篇文章; 若留空白'',则推荐最近更新文章 HEO_HERO_RECOMMEND_POST_TAG: '推荐', @@ -37,22 +38,23 @@ const CONFIG = { // 右侧个人资料卡牌欢迎语,点击可自动切换 HEO_INFOCARD_GREETINGS: [ - '你好!我是', - '🔍 分享与热心帮助', - '🤝 专修交互与设计', - '🏃 脚踏实地行动派', - '🏠 智能家居小能手', - '🤖️ 数码科技爱好者', - '🧱 团队小组发动机' + '🎨 艺术创作发烧友', + '💻 编程技巧分享者', + '🏠 捕捉生活的瞬间', + '📹 视频创作艺术家', + '🔍 挖掘编程的秘密', + '🏃 不放弃无限进步', + '🧱 现实中唯唯诺诺', + '💢 互联网重拳出击' ], // 个人资料底部按钮 - HEO_INFO_CARD_URL1: '/about', - HEO_INFO_CARD_ICON1: 'fas fa-user', - HEO_INFO_CARD_URL2: 'https://github.com/tangly1024', + HEO_INFO_CARD_URL1: 'https://space.bilibili.com/46377861', + HEO_INFO_CARD_ICON1: 'fa-brands fa-bilibili', + HEO_INFO_CARD_URL2: 'https://github.com/laogou717', HEO_INFO_CARD_ICON2: 'fab fa-github', - HEO_INFO_CARD_URL3: 'https://www.tangly1024.com', - HEO_INFO_CARD_TEXT3: '了解更多', + HEO_INFO_CARD_URL3: 'https://nav.laogou717.com', + HEO_INFO_CARD_TEXT3: '免费AI工具', // 用户技能图标 HEO_GROUP_ICONS: [ @@ -118,7 +120,7 @@ const CONFIG = { HEO_SOCIAL_CARD_TITLE_1: '交流频道', HEO_SOCIAL_CARD_TITLE_2: '加入我们的社群讨论分享', HEO_SOCIAL_CARD_TITLE_3: '点击加入社群', - HEO_SOCIAL_CARD_URL: 'https://docs.tangly1024.com/article/how-to-question', + HEO_SOCIAL_CARD_URL: 'https://qm.qq.com/q/MDtzhPE2qs', // ***** 以下配置无效,只是预留开发 **** // 菜单配置 @@ -129,7 +131,7 @@ const CONFIG = { HEO_MENU_SEARCH: true, // 显示搜索 HEO_POST_LIST_COVER: true, // 列表显示文章封面 - HEO_POST_LIST_COVER_HOVER_ENLARGE: false, // 列表鼠标悬停放大 + HEO_POST_LIST_COVER_HOVER_ENLARGE: true, // 列表鼠标悬停放大 HEO_POST_LIST_COVER_DEFAULT: true, // 封面为空时用站点背景做默认封面 HEO_POST_LIST_SUMMARY: true, // 文章摘要 @@ -141,7 +143,7 @@ const CONFIG = { HEO_ARTICLE_RECOMMEND: true, // 文章关联推荐 HEO_WIDGET_LATEST_POSTS: true, // 显示最新文章卡 - HEO_WIDGET_ANALYTICS: false, // 显示统计卡 + HEO_WIDGET_ANALYTICS: true, // 显示统计卡 HEO_WIDGET_TO_TOP: true, HEO_WIDGET_TO_COMMENT: true, // 跳到评论区 HEO_WIDGET_DARK_MODE: true, // 夜间模式 From cb759f9b484805ce4c6693be2eb08f98cf3a0067 Mon Sep 17 00:00:00 2001 From: JonasTech0 Date: Thu, 12 Sep 2024 10:39:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=BF=98=E5=8E=9FHeo=E4=B8=BB=E9=A2=98conf?= =?UTF-8?q?ig.js=E9=BB=98=E8=AE=A4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/heo/config.js | 54 +++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/themes/heo/config.js b/themes/heo/config.js index ad3d6a114ed..436ad33daa6 100644 --- a/themes/heo/config.js +++ b/themes/heo/config.js @@ -4,13 +4,12 @@ const CONFIG = { HEO_HOME_BANNER_ENABLE: true, - HEO_SITE_CREATE_TIME: '2023-02-21', // 建站日期,用于计算网站运行的第几天 + HEO_SITE_CREATE_TIME: '2021-09-21', // 建站日期,用于计算网站运行的第几天 // 首页顶部通知条滚动内容,如不需要可以留空 [] HEO_NOTICE_BAR: [ - { title: '👏欢迎来到我的博客', url: 'https://nav.laogou717.com' }, - { title: '🔥访问导航网站,获取更多免费AI工具', url: 'https://nav.laogou717.com' }, - { title: ' 🔱 🐹 🫵 我来助你!', url: 'https://nav.laogou717.com' } + { title: '欢迎来到我的博客', url: 'https://blog.tangly1024.com' }, + { title: '访问文档中心获取更多帮助', url: 'https://docs.tangly1024.com' } ], // 英雄区左右侧组件颠倒位置 @@ -19,17 +18,17 @@ const CONFIG = { HEO_HERO_BODY_REVERSE: false, // 英雄区(首页顶部大卡) - HEO_HERO_TITLE_1: '热爱生活', - HEO_HERO_TITLE_2: '无限进步', - HEO_HERO_TITLE_3: '神烦老狗', - HEO_HERO_TITLE_4: '我们的目标是', - HEO_HERO_TITLE_5: '星辰大海', - HEO_HERO_TITLE_LINK: 'https://www.laogou666.com', + HEO_HERO_TITLE_1: '分享编程', + HEO_HERO_TITLE_2: '与思维认知', + HEO_HERO_TITLE_3: 'TANGLY1024.COM', + HEO_HERO_TITLE_4: '新版上线', + HEO_HERO_TITLE_5: 'NotionNext4.0 轻松定制主题', + HEO_HERO_TITLE_LINK: 'https://tangly1024.com', // 英雄区显示三个置顶分类 - HEO_HERO_CATEGORY_1: { title: '干货精选', url: '/tag/干货精选' }, + HEO_HERO_CATEGORY_1: { title: '必看精选', url: '/tag/必看精选' }, HEO_HERO_CATEGORY_2: { title: '热门文章', url: '/tag/热门文章' }, - HEO_HERO_CATEGORY_3: { title: '狂人日记', url: '/tag/狂人日记' }, + HEO_HERO_CATEGORY_3: { title: '实用教程', url: '/tag/实用教程' }, // 英雄区右侧推荐文章标签, 例如 [推荐] , 最多六篇文章; 若留空白'',则推荐最近更新文章 HEO_HERO_RECOMMEND_POST_TAG: '推荐', @@ -38,23 +37,22 @@ const CONFIG = { // 右侧个人资料卡牌欢迎语,点击可自动切换 HEO_INFOCARD_GREETINGS: [ - '🎨 艺术创作发烧友', - '💻 编程技巧分享者', - '🏠 捕捉生活的瞬间', - '📹 视频创作艺术家', - '🔍 挖掘编程的秘密', - '🏃 不放弃无限进步', - '🧱 现实中唯唯诺诺', - '💢 互联网重拳出击' + '你好!我是', + '🔍 分享与热心帮助', + '🤝 专修交互与设计', + '🏃 脚踏实地行动派', + '🏠 智能家居小能手', + '🤖️ 数码科技爱好者', + '🧱 团队小组发动机' ], // 个人资料底部按钮 - HEO_INFO_CARD_URL1: 'https://space.bilibili.com/46377861', - HEO_INFO_CARD_ICON1: 'fa-brands fa-bilibili', - HEO_INFO_CARD_URL2: 'https://github.com/laogou717', + HEO_INFO_CARD_URL1: '/about', + HEO_INFO_CARD_ICON1: 'fas fa-user', + HEO_INFO_CARD_URL2: 'https://github.com/tangly1024', HEO_INFO_CARD_ICON2: 'fab fa-github', - HEO_INFO_CARD_URL3: 'https://nav.laogou717.com', - HEO_INFO_CARD_TEXT3: '免费AI工具', + HEO_INFO_CARD_URL3: 'https://www.tangly1024.com', + HEO_INFO_CARD_TEXT3: '了解更多', // 用户技能图标 HEO_GROUP_ICONS: [ @@ -120,7 +118,7 @@ const CONFIG = { HEO_SOCIAL_CARD_TITLE_1: '交流频道', HEO_SOCIAL_CARD_TITLE_2: '加入我们的社群讨论分享', HEO_SOCIAL_CARD_TITLE_3: '点击加入社群', - HEO_SOCIAL_CARD_URL: 'https://qm.qq.com/q/MDtzhPE2qs', + HEO_SOCIAL_CARD_URL: 'https://docs.tangly1024.com/article/how-to-question', // ***** 以下配置无效,只是预留开发 **** // 菜单配置 @@ -131,7 +129,7 @@ const CONFIG = { HEO_MENU_SEARCH: true, // 显示搜索 HEO_POST_LIST_COVER: true, // 列表显示文章封面 - HEO_POST_LIST_COVER_HOVER_ENLARGE: true, // 列表鼠标悬停放大 + HEO_POST_LIST_COVER_HOVER_ENLARGE: false, // 列表鼠标悬停放大 HEO_POST_LIST_COVER_DEFAULT: true, // 封面为空时用站点背景做默认封面 HEO_POST_LIST_SUMMARY: true, // 文章摘要 @@ -143,7 +141,7 @@ const CONFIG = { HEO_ARTICLE_RECOMMEND: true, // 文章关联推荐 HEO_WIDGET_LATEST_POSTS: true, // 显示最新文章卡 - HEO_WIDGET_ANALYTICS: true, // 显示统计卡 + HEO_WIDGET_ANALYTICS: false, // 显示统计卡 HEO_WIDGET_TO_TOP: true, HEO_WIDGET_TO_COMMENT: true, // 跳到评论区 HEO_WIDGET_DARK_MODE: true, // 夜间模式 From b9632d207732ea6058e3dab9cba2047ab038be91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E6=9E=AB?= <128354383+laogou717@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:33:03 +0800 Subject: [PATCH 3/5] Update NotionIcon.js --- components/NotionIcon.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/components/NotionIcon.js b/components/NotionIcon.js index 832fc722167..e60b064008e 100644 --- a/components/NotionIcon.js +++ b/components/NotionIcon.js @@ -5,18 +5,16 @@ import LazyImage from './LazyImage' * 可能是emoji 可能是 svg 也可能是 图片 * @returns */ -const NotionIcon = ({ icon, className = 'w-8 h-8 my-auto inline mr-1' }) => { +const NotionIcon = ({ icon }) => { if (!icon) { return <> } if (icon.startsWith('http') || icon.startsWith('data:')) { - // 这里优先使用传入的 className - return + return } - // 对于 emoji 或 svg,设置默认 className,也可以传递不同的样式 - return {icon} + return {icon} } -export default NotionIcon \ No newline at end of file +export default NotionIcon From 069f9058ac3dfb474e97b34cfb5b30911016ed88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E6=9E=AB?= <128354383+laogou717@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:34:13 +0800 Subject: [PATCH 4/5] Update BlogPostCard.js --- themes/heo/components/BlogPostCard.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/themes/heo/components/BlogPostCard.js b/themes/heo/components/BlogPostCard.js index 3f1921a0022..c6e09f4a537 100644 --- a/themes/heo/components/BlogPostCard.js +++ b/themes/heo/components/BlogPostCard.js @@ -1,5 +1,5 @@ import LazyImage from '@/components/LazyImage' -import NotionIcon from '@/components/NotionIcon' +import NotionIcon from './NotionIcon' import { siteConfig } from '@/lib/config' import Link from 'next/link' import CONFIG from '../config' @@ -83,9 +83,9 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { }> {siteConfig('POST_TITLE_ICON') && ( + icon={post.pageIcon} + className="heo-icon w-6 h-6 mr-1 align-middle transform translate-y-[-8%]" // 专门为 Heo 主题的图标设置样式 + /> )} {post.title} @@ -112,4 +112,4 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { ) } -export default BlogPostCard \ No newline at end of file +export default BlogPostCard From e456de6a0f5dd4e76374a0050db040890902830e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E6=9E=AB?= <128354383+laogou717@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:34:49 +0800 Subject: [PATCH 5/5] Create NotionIcon.js --- themes/heo/components/NotionIcon.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 themes/heo/components/NotionIcon.js diff --git a/themes/heo/components/NotionIcon.js b/themes/heo/components/NotionIcon.js new file mode 100644 index 00000000000..c6d5bed170c --- /dev/null +++ b/themes/heo/components/NotionIcon.js @@ -0,0 +1,22 @@ +import LazyImage from '@/components/LazyImage' + +/** + * notion的图标icon + * 可能是emoji 可能是 svg 也可能是 图片 + * @returns + */ +const NotionIcon = ({ icon, className = 'w-8 h-8 my-auto inline mr-1' }) => { + if (!icon) { + return <> + } + + if (icon.startsWith('http') || icon.startsWith('data:')) { + // 这里优先使用传入的 className + return + } + + // 对于 emoji 或 svg,设置默认 className,也可以传递不同的样式 + return {icon} +} + +export default NotionIcon