From c20ad9973edd389fb57d9a125acbb59cd8d6a701 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Fri, 1 Dec 2023 18:38:24 +0800 Subject: [PATCH] =?UTF-8?q?SEO=20=E4=BC=98=E5=8C=96=E9=A6=96=E5=B1=8F?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E4=BD=93=E7=A7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 1 + components/AOSAnimation.js | 12 ++++++ components/Equation.js | 6 ++- components/ExternalPlugins.js | 4 ++ components/KatexReact.js | 13 +++++-- components/Live2D.js | 4 ++ components/LoadingProgress.js | 29 ++++++++++++++ components/NotionPage.js | 20 ++++++++-- components/ShareBar.js | 26 +++++-------- components/ShareButtons.js | 9 ++++- lib/global.js | 15 +++----- next.config.js | 9 +++-- pages/_app.js | 21 +++++----- themes/simple/components/ArticleInfo.js | 7 +++- themes/simple/components/ArticleLock.js | 2 +- themes/simple/components/BlogListPage.js | 7 +++- themes/simple/components/BlogListScroll.js | 7 +++- themes/simple/components/Footer.js | 7 +++- themes/simple/components/Header.js | 2 +- themes/simple/components/NavBar.js | 2 +- themes/simple/components/SideBar.js | 7 +++- themes/simple/components/TopBar.js | 2 +- themes/simple/index.js | 45 ++++++++++++---------- 23 files changed, 174 insertions(+), 83 deletions(-) create mode 100644 components/AOSAnimation.js create mode 100644 components/LoadingProgress.js diff --git a/blog.config.js b/blog.config.js index 39e8336b..94b978ab 100644 --- a/blog.config.js +++ b/blog.config.js @@ -405,6 +405,7 @@ const BLOG = { DEBUG: process.env.NEXT_PUBLIC_DEBUG || false, // 是否显示调试按钮 ENABLE_CACHE: process.env.ENABLE_CACHE || process.env.npm_lifecycle_event === 'build', // 缓存在开发调试和打包过程中选择性开启,正式部署开启此功能意义不大。 isProd: process.env.VERCEL_ENV === 'production', // distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables) isProd: process.env.VERCEL_ENV === 'production' // distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables) + BUNDLE_ANALYZER: process.env.ANALYZE === 'true' || true, // 编译时是否展示内容 VERSION: process.env.NEXT_PUBLIC_VERSION // 版本号 } diff --git a/components/AOSAnimation.js b/components/AOSAnimation.js new file mode 100644 index 00000000..c5dd4d92 --- /dev/null +++ b/components/AOSAnimation.js @@ -0,0 +1,12 @@ +import AOS from 'aos' +import { isBrowser } from 'react-notion-x' + +/** + * 加载滚动动画 + * https://michalsnik.github.io/aos/ + */ +export default function AOSAnimation() { + if (isBrowser) { + AOS.init() + } +} diff --git a/components/Equation.js b/components/Equation.js index 4872ad87..86685d62 100644 --- a/components/Equation.js +++ b/components/Equation.js @@ -8,8 +8,12 @@ const katexSettings = { strict: false } +/** + * 数学公式 + * @param {} param0 + * @returns + */ export const Equation = ({ block, math, inline = false, className, ...rest }) => { -// const { recordMap } = useNotionContext() math = math || getBlockTitle(block, null) if (!math) return null diff --git a/components/ExternalPlugins.js b/components/ExternalPlugins.js index 813025c0..5dd00db3 100644 --- a/components/ExternalPlugins.js +++ b/components/ExternalPlugins.js @@ -22,6 +22,8 @@ const VConsole = dynamic(() => import('@/components/VConsole'), { ssr: false }) const CustomContextMenu = dynamic(() => import('@/components/CustomContextMenu'), { ssr: false }) const DisableCopy = dynamic(() => import('@/components/DisableCopy'), { ssr: false }) const AdBlockDetect = dynamic(() => import('@/components/AdBlockDetect'), { ssr: false }) +const LoadingProgress = dynamic(() => import('@/components/LoadingProgress'), { ssr: false }) +const AosAnimation = dynamic(() => import('@/components/AosAnimation'), { ssr: false }) /** * 各种插件脚本 @@ -91,6 +93,8 @@ const ExternalPlugin = (props) => { {WEB_WHIZ_ENABLED && } {AD_WWADS_BLOCK_DETECT && } + + {CHATBASE_ID && (<>