From 4cb317a791269d1efd892a9c1f8d7989e7e2810d Mon Sep 17 00:00:00 2001 From: laye0619 Date: Sat, 24 Feb 2024 11:05:31 +0800 Subject: [PATCH] new_temp --- themes/heo/components/DarkModeButton.js | 4 +- themes/heo/components/FloatDarkModeButton.js | 4 +- themes/heo/components/InfoCard.js | 6 +- themes/heo/components/MenuGroupCard.js | 1 + themes/heo/components/MenuItemDrop.js | 4 +- themes/heo/components/SideRight.js | 2 + themes/heo/config.js | 95 ++++++++++---------- themes/heo/index.js | 29 ++++-- 8 files changed, 84 insertions(+), 61 deletions(-) diff --git a/themes/heo/components/DarkModeButton.js b/themes/heo/components/DarkModeButton.js index 9b56e6da6f2..bef62962a0c 100644 --- a/themes/heo/components/DarkModeButton.js +++ b/themes/heo/components/DarkModeButton.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import { saveDarkModeToCookies } from '@/themes/theme' +import { saveDarkModeToLocalStorage } from '@/themes/theme' import { Moon, Sun } from '@/components/HeroIcons' import { useImperativeHandle } from 'react' @@ -24,7 +24,7 @@ const DarkModeButton = (props) => { // 用户手动设置主题 const handleChangeDarkMode = () => { const newStatus = !isDarkMode - saveDarkModeToCookies(newStatus) + saveDarkModeToLocalStorage(newStatus) updateDarkMode(newStatus) const htmlElement = document.getElementsByTagName('html')[0] htmlElement.classList?.remove(newStatus ? 'light' : 'dark') diff --git a/themes/heo/components/FloatDarkModeButton.js b/themes/heo/components/FloatDarkModeButton.js index ec480ee4042..0918093bee5 100644 --- a/themes/heo/components/FloatDarkModeButton.js +++ b/themes/heo/components/FloatDarkModeButton.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import { saveDarkModeToCookies } from '@/themes/theme' +import { saveDarkModeToLocalStorage } from '@/themes/theme' import CONFIG from '../config' import { siteConfig } from '@/lib/config' @@ -13,7 +13,7 @@ export default function FloatDarkModeButton () { // 用户手动设置主题 const handleChangeDarkMode = () => { const newStatus = !isDarkMode - saveDarkModeToCookies(newStatus) + saveDarkModeToLocalStorage(newStatus) updateDarkMode(newStatus) const htmlElement = document.getElementsByTagName('html')[0] htmlElement.classList?.remove(newStatus ? 'light' : 'dark') diff --git a/themes/heo/components/InfoCard.js b/themes/heo/components/InfoCard.js index 37f80a6f93b..4fad98ac976 100644 --- a/themes/heo/components/InfoCard.js +++ b/themes/heo/components/InfoCard.js @@ -41,13 +41,13 @@ export function InfoCard(props) {
{/* 两个社交按钮 */} - {/*
+
-
*/} +
@@ -80,7 +80,7 @@ function MoreButton() { return
-
关于我
+
了解更多
} diff --git a/themes/heo/components/MenuGroupCard.js b/themes/heo/components/MenuGroupCard.js index 53157875adc..e1de4792940 100644 --- a/themes/heo/components/MenuGroupCard.js +++ b/themes/heo/components/MenuGroupCard.js @@ -1,6 +1,7 @@ import Link from 'next/link' import { useGlobal } from '@/lib/global' import CONFIG from '../config' +import { siteConfig } from '@/lib/config' const MenuGroupCard = (props) => { const { postCount, categoryOptions, tagOptions } = props diff --git a/themes/heo/components/MenuItemDrop.js b/themes/heo/components/MenuItemDrop.js index d6381d03198..97128d5fbce 100644 --- a/themes/heo/components/MenuItemDrop.js +++ b/themes/heo/components/MenuItemDrop.js @@ -16,13 +16,13 @@ export const MenuItemDrop = ({ link }) => { + className=" hover:bg-black hover:bg-opacity-10 rounded-2xl flex justify-center items-center px-3 py-1 no-underline tracking-widest"> {link?.icon && } {link?.name} } {/* 含子菜单的按钮 */} {hasSubMenu && <> -
+
{link?.icon && } {link?.name}
} diff --git a/themes/heo/components/SideRight.js b/themes/heo/components/SideRight.js index ec1d4fb74f9..775b9b7687a 100644 --- a/themes/heo/components/SideRight.js +++ b/themes/heo/components/SideRight.js @@ -38,6 +38,8 @@ export default function SideRight(props) {
+ + {/* 文章页显示目录 */} {post && post.toc && post.toc.length > 0 && ( diff --git a/themes/heo/config.js b/themes/heo/config.js index e9789a5243f..c8e730ea3eb 100644 --- a/themes/heo/config.js +++ b/themes/heo/config.js @@ -1,12 +1,12 @@ const CONFIG = { HEO_HOME_BANNER_ENABLE: true, - HEO_SITE_CREATE_TIME: '2022-01-07', // 建站日期,用于计算网站运行的第几天 + HEO_SITE_CREATE_TIME: '2021-09-21', // 建站日期,用于计算网站运行的第几天 // 首页顶部通知条滚动内容,如不需要可以留空 [] HEO_NOTICE_BAR: [ - // { title: '欢迎来到我的博客', url: 'https://blog.tangly1024.com' }, - // { title: '访问文档中心获取更多帮助', url: 'https://docs.tangly1024.com' } + { title: '欢迎来到我的博客', url: 'https://blog.tangly1024.com' }, + { title: '访问文档中心获取更多帮助', url: 'https://docs.tangly1024.com' } ], // 英雄区左右侧组件颠倒位置 @@ -15,17 +15,17 @@ const CONFIG = { HEO_HERO_BODY_REVERSE: false, // 英雄区(首页顶部大卡) - HEO_HERO_TITLE_1: '投资人生', - HEO_HERO_TITLE_2: '财务自由', - HEO_HERO_TITLE_3: 'LAYE.WANG', - HEO_HERO_TITLE_4: 'PHOTOGRAPHY', - HEO_HERO_TITLE_5: '我的摄影', - HEO_HERO_TITLE_LINK: 'https://p.laye.wang', + 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_2: { title: '热门话题', url: '/tag/热门话题' }, - HEO_HERO_CATEGORY_3: { title: '日期归档', url: '/archive' }, + HEO_HERO_CATEGORY_1: { title: '必看精选', url: '/tag/必看精选' }, + HEO_HERO_CATEGORY_2: { title: '热门文章', url: '/tag/热门文章' }, + HEO_HERO_CATEGORY_3: { title: '实用教程', url: '/tag/实用教程' }, // 英雄区右侧推荐文章标签, 例如 [推荐] , 最多六篇文章; 若留空白'',则推荐最近更新文章 HEO_HERO_RECOMMEND_POST_TAG: '推荐', @@ -34,74 +34,77 @@ const CONFIG = { // 右侧个人资料卡牌欢迎语,点击可自动切换 HEO_INFOCARD_GREETINGS: [ - '你好!我是...', - '🏧 投资实践者', - '📷 摄影爱好者', - '🏦 财务自由行动派' + '你好!我是', + '🔍 分享与热心帮助', + '🤝 专修交互与设计', + '🏃 脚踏实地行动派', + '🏠 智能家居小能手', + '🤖️ 数码科技爱好者', + '🧱 团队小组发动机' ], - HEO_INFO_CARD_URL: 'https://laye.wang', // 个人资料底部按钮链接 + HEO_INFO_CARD_URL: 'https://github.com/tangly1024/NotionNext', // 个人资料底部按钮链接 // 用户技能图标 HEO_GROUP_ICONS: [ { - title_1: 'investment1', - img_1: '/images/laye/investment1.png', + title_1: 'AfterEffect', + img_1: '/images/heo/20239df3f66615b532ce571eac6d14ff21cf072602.webp', color_1: '#989bf8', - title_2: 'yo1', - img_2: '/images/laye/yo1.png', + title_2: 'Sketch', + img_2: '/images/heo/2023e0ded7b724a39f12d59c3dc8fbdc7cbe074202.webp', color_2: '#ffffff' }, { - title_1: 'photography1', - img_1: '/images/laye/photography1.png', + title_1: 'Docker', + img_1: '/images/heo/20231108a540b2862d26f8850172e4ea58ed075102.webp', color_1: '#57b6e6', - title_2: 'investment2', - img_2: '/images/laye/investment2.png', + title_2: 'Photoshop', + img_2: '/images/heo/2023e4058a91608ea41751c4f102b131f267075902.webp', color_2: '#4082c3' }, { - title_1: 'investment3', - img_1: '/images/laye/investment3.png', + title_1: 'FinalCutPro', + img_1: '/images/heo/20233e777652412247dd57fd9b48cf997c01070702.webp', color_1: '#ffffff', - title_2: 'yo2', - img_2: '/images/laye/yo2.png', + title_2: 'Python', + img_2: '/images/heo/20235c0731cd4c0c95fc136a8db961fdf963071502.webp', color_2: '#ffffff' }, { - title_1: 'photography2', - img_1: '/images/laye/photography2.png', + title_1: 'Swift', + img_1: '/images/heo/202328bbee0b314297917b327df4a704db5c072402.webp', color_1: '#eb6840', - title_2: 'investment4', - img_2: '/images/laye/investment4.png', + title_2: 'Principle', + img_2: '/images/heo/2023f76570d2770c8e84801f7e107cd911b5073202.webp', color_2: '#8f55ba' }, { - title_1: 'investment5', - img_1: '/images/laye/investment5.png', + title_1: 'illustrator', + img_1: '/images/heo/20237359d71b45ab77829cee5972e36f8c30073902.webp', color_1: '#f29e39', - title_2: 'yo3', - img_2: '/images/laye/yo3.png', + title_2: 'CSS3', + img_2: '/images/heo/20237c548846044a20dad68a13c0f0e1502f074602.webp', color_2: '#2c51db' }, { - title_1: 'photography3', - img_1: '/images/laye/photography3.png', + title_1: 'JS', + img_1: '/images/heo/2023786e7fc488f453d5fb2be760c96185c0075502.webp', color_1: '#f7cb4f', - title_2: 'investment6', - img_2: '/images/laye/investment6.png', + title_2: 'HTML', + img_2: '/images/heo/202372b4d760fd8a497d442140c295655426070302.webp', color_2: '#e9572b' }, { - title_1: 'investment7', - img_1: '/images/laye/investment7.png', + title_1: 'Git', + img_1: '/images/heo/2023ffa5707c4e25b6beb3e6a3d286ede4c6071102.webp', color_1: '#df5b40', - title_2: 'yo4', - img_2: '/images/laye/yo4.png', + title_2: 'Rhino', + img_2: '/images/heo/20231ca53fa0b09a3ff1df89acd7515e9516173302.webp', color_2: '#1f1f1f' } ], - HEO_SOCIAL_CARD: false, // 是否显示右侧,点击加入社群按钮 + HEO_SOCIAL_CARD: true, // 是否显示右侧,点击加入社群按钮 HEO_SOCIAL_CARD_TITLE_1: '交流频道', HEO_SOCIAL_CARD_TITLE_2: '加入我们的社群讨论分享', HEO_SOCIAL_CARD_TITLE_3: '点击加入社群', diff --git a/themes/heo/index.js b/themes/heo/index.js index 54d328edf47..f10be1a20ca 100644 --- a/themes/heo/index.js +++ b/themes/heo/index.js @@ -39,6 +39,7 @@ import LazyImage from '@/components/LazyImage' import WWAds from '@/components/WWAds' import { AdSlot } from '@/components/GoogleAdsense' import { siteConfig } from '@/lib/config' +import { isBrowser } from '@/lib/utils' /** * 基础布局 采用上中下布局,移动端使用顶部侧边导航栏 @@ -83,7 +84,7 @@ const LayoutBase = props => { return (