diff --git a/README_EN.md b/README_EN.md index dbb75684a73..dd4063e5944 100644 --- a/README_EN.md +++ b/README_EN.md @@ -35,15 +35,15 @@ Live Demo:[https://preview.tangly1024.com/](https://preview.tangly1024.com/) It only takes a few minutes to set up your personal site: -- [Quick Deployment Tutorial - Multiple Options Available](https://tangly1024.com/article/notion-next) +- [Quick Deployment Tutorial - Multiple Options Available](https://docs.tangly1024.com/article/vercel-deploy-notion-next) -- [Customization Guide - How to Configure Feature Plugins](https://tangly1024.com/article/notion-next-guide) +- [Customization Guide - How to Configure Feature Plugins](https://docs.tangly1024.com/article/how-to-config-notion-next) -- [Development Guide - How to Conduct Local Development](https://tangly1024.com/article/how-to-develop-with-notion-next) +- [Development Guide - How to Conduct Local Development](https://docs.tangly1024.com/article/how-to-develop-with-notion-next) -- [Update Guide - How to Get the Latest Upgrade Patch](https://tangly1024.com/article/how-to-update-notionnext) +- [Update Guide - How to Get the Latest Upgrade Patch](https://docs.tangly1024.com/article/how-to-update-notionnext) -- [Version History - Check Feature Highlights for Each Version](https://tangly1024.com/article/notion-next-changelogs) +- [Version History - Check Feature Highlights for Each Version](https://docs.tangly1024.com/article/latest) ## Acknowledgements diff --git a/components/Fireworks.js b/components/Fireworks.js index cb6a2d98473..e61585f1682 100644 --- a/components/Fireworks.js +++ b/components/Fireworks.js @@ -35,7 +35,11 @@ const Fireworks = () => { loadFireworks() return () => { - // 在组件卸载时清理资源(如果需要) + // 在组件卸载时清理资源 + const fireworksElements = document.getElementsByClassName('fireworks') + while (fireworksElements.length > 0) { + fireworksElements[0].parentNode.removeChild(fireworksElements[0]) + } } }, []) diff --git a/components/MouseFollow.js b/components/MouseFollow.js index 2215a0cef9a..cc10d29c672 100644 --- a/components/MouseFollow.js +++ b/components/MouseFollow.js @@ -15,8 +15,26 @@ const MOUSE_FOLLOW = () => { loadExternalResource('/js/mouse-follow.js', 'js').then(url => { window.createMouseCanvas && window.createMouseCanvas()({ type, color }) }) + + return () => { + // 在组件卸载时清理资源 + const mouseFollowElement = document.getElementById('vixcityCanvas') + mouseFollowElement?.parentNode?.removeChild(mouseFollowElement) + } }, []) - return <> + return ( + <> + + + ) } export default MOUSE_FOLLOW diff --git a/themes/fukasawa/components/AsideLeft.js b/themes/fukasawa/components/AsideLeft.js index f534d1b68c8..b0ea23131ba 100644 --- a/themes/fukasawa/components/AsideLeft.js +++ b/themes/fukasawa/components/AsideLeft.js @@ -1,22 +1,22 @@ -import Logo from './Logo' -import GroupCategory from './GroupCategory' -import { MenuList } from './MenuList' -import GroupTag from './GroupTag' -import SearchInput from './SearchInput' -import SiteInfo from './SiteInfo' -import Catalog from './Catalog' -import Announcement from './Announcement' -import { useRouter } from 'next/router' import DarkModeButton from '@/components/DarkModeButton' -import SocialButton from './SocialButton' -import CONFIG from '@/themes/fukasawa/config' import { AdSlot } from '@/components/GoogleAdsense' import { siteConfig } from '@/lib/config' -import MailChimpForm from './MailChimpForm' import { useGlobal } from '@/lib/global' -import { useEffect, useMemo, useState } from 'react' import { isBrowser } from '@/lib/utils' +import CONFIG from '@/themes/fukasawa/config' import { debounce } from 'lodash' +import { useRouter } from 'next/router' +import { useEffect, useMemo, useState } from 'react' +import Announcement from './Announcement' +import Catalog from './Catalog' +import GroupCategory from './GroupCategory' +import GroupTag from './GroupTag' +import Logo from './Logo' +import MailChimpForm from './MailChimpForm' +import { MenuList } from './MenuList' +import SearchInput from './SearchInput' +import SiteInfo from './SiteInfo' +import SocialButton from './SocialButton' /** * 侧边栏 @@ -24,16 +24,41 @@ import { debounce } from 'lodash' * @returns */ function AsideLeft(props) { - const { tagOptions, currentTag, categoryOptions, currentCategory, post, slot, notice } = props + const { + tagOptions, + currentTag, + categoryOptions, + currentCategory, + post, + slot, + notice + } = props const router = useRouter() const { fullWidth } = useGlobal() - const FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT = fullWidth || siteConfig('FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT', null, CONFIG) + const FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT = + fullWidth || + siteConfig('FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT', null, CONFIG) + + const FUKASAWA_SIDEBAR_COLLAPSE_ON_SCROLL = siteConfig( + 'FUKASAWA_SIDEBAR_COLLAPSE_ON_SCROLL', + false, + CONFIG + ) + + const FUKASAWA_SIDEBAR_COLLAPSE_BUTTON = siteConfig( + 'FUKASAWA_SIDEBAR_COLLAPSE_BUTTON', + null, + CONFIG + ) // 侧边栏折叠从 本地存储中获取 open 状态的初始值 const [isCollapsed, setIsCollapse] = useState(() => { if (typeof window !== 'undefined') { - return localStorage.getItem('fukasawa-sidebar-collapse') === 'true' || FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT + return ( + localStorage.getItem('fukasawa-sidebar-collapse') === 'true' || + FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT + ) } return FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT }) @@ -69,7 +94,7 @@ function AsideLeft(props) { // 自动折叠侧边栏 onResize 窗口宽度小于1366 || 滚动条滚动至页面的300px时 ; 将open设置为false useEffect(() => { - if (!siteConfig('FUKASAWA_SIDEBAR_COLLAPSE_ON_SCROLL', false, CONFIG)) { + if (!FUKASAWA_SIDEBAR_COLLAPSE_ON_SCROLL) { return } const handleResize = debounce(() => { @@ -92,73 +117,89 @@ function AsideLeft(props) { } } }, []) - - - return