Merge pull request #999 from tangly1024/feat/vercel-analytics

Feat/vercel analytics
This commit is contained in:
tangly1024
2023-04-21 13:34:58 +08:00
committed by GitHub
3 changed files with 5 additions and 0 deletions

View File

@@ -254,6 +254,7 @@ const BLOG = {
// <---- 评论插件
// ----> 站点统计
ANALYTICS_VERCEL: process.env.NEXT_PUBLIC_ANALYTICS_VERCEL || true, // vercel自带的统计 https://vercel.com/docs/concepts/analytics/quickstart https://github.com/tangly1024/NotionNext/issues/897
ANALYTICS_BUSUANZI_ENABLE: true, // 展示网站阅读量、访问数 see http://busuanzi.ibruce.info/
ANALYTICS_BAIDU_ID: process.env.NEXT_PUBLIC_ANALYTICS_BAIDU_ID || '', // e.g 只需要填写百度统计的id[baidu_id] -> https://hm.baidu.com/hm.js?[baidu_id]
ANALYTICS_CNZZ_ID: process.env.NEXT_PUBLIC_ANALYTICS_CNZZ_ID || '', // 只需要填写站长统计的id, [cnzz_id] -> https://s9.cnzz.com/z_stat.php?id=[cnzz_id]&web_id=[cnzz_id]

View File

@@ -1,4 +1,5 @@
import BLOG from '@/blog.config'
import { Analytics } from '@vercel/analytics/react'
/**
* 第三方代码 统计脚本
@@ -7,6 +8,8 @@ import BLOG from '@/blog.config'
*/
const CommonScript = () => {
return (<>
{BLOG.ANALYTICS_VERCEL && <Analytics />}
{BLOG.COMMENT_DAO_VOICE_ID && (<>
{/* DaoVoice 反馈 */}
<script async dangerouslySetInnerHTML={{

View File

@@ -23,6 +23,7 @@
"@giscus/react": "^2.2.6",
"@next/bundle-analyzer": "^12.1.1",
"@popperjs/core": "^2.9.3",
"@vercel/analytics": "^1.0.0",
"animate.css": "^4.1.1",
"animejs": "^3.2.1",
"aos": "^3.0.0-beta.6",