From 38378a332387108a3eb53a7b984a6e56f28c75d8 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 8 Nov 2023 21:52:12 +0800 Subject: [PATCH] =?UTF-8?q?common-script=20=E9=85=8D=E7=BD=AE=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Comment.js | 1 + components/CommonScript.js | 113 ------------------ components/CusdisComponent.js | 19 +-- components/ExternalPlugins.js | 142 +++++++++++++++++++---- components/Giscus.js | 1 - components/WWAds.js | 11 +- next.config.js | 1 + pages/_document.js | 2 - themes/simple/components/MenuItemDrop.js | 4 +- 9 files changed, 142 insertions(+), 152 deletions(-) delete mode 100644 components/CommonScript.js diff --git a/components/Comment.js b/components/Comment.js index 3cc9b76e..d150e805 100644 --- a/components/Comment.js +++ b/components/Comment.js @@ -63,6 +63,7 @@ const ValineComponent = dynamic(() => import('@/components/ValineComponent'), { const Comment = ({ siteInfo, frontMatter, className }) => { const router = useRouter() + // 当连接中有特殊参数时跳转到评论区 if (isBrowser && ('giscus' in router.query || router.query.target === 'comment')) { setTimeout(() => { const url = router.asPath.replace('?target=comment', '') diff --git a/components/CommonScript.js b/components/CommonScript.js deleted file mode 100644 index 779432ba..00000000 --- a/components/CommonScript.js +++ /dev/null @@ -1,113 +0,0 @@ -import BLOG from '@/blog.config' - -/** - * 统计脚本 - * @returns {JSX.Element} - * @constructor - */ -const CommonScript = () => { - return (<> - - {BLOG.CHATBASE_ID && (<> - } - - {BLOG.COMMENT_CUSDIS_APP_ID && } + + {siteConfig('COMMENT_TWIKOO_ENV_ID') &&