减少第三方

This commit is contained in:
tangly1024
2021-10-19 15:12:20 +08:00
parent e4f7e17974
commit 31c229a3c5
4 changed files with 16 additions and 10 deletions

View File

@@ -33,8 +33,9 @@ const BLOG = {
gaConfig: {
measurementId: 'G-5EV4HZD0XX' // e.g: G-XXXXXXXXXX
},
baidyAnalytics: 'f683ef76f06bb187cbed5546f6f28f28', // e.g only need xxxxx -> https://hm.baidu.com/hm.js?xxxxx
busuanzi: true // see http://busuanzi.ibruce.info/
baiduAnalytics: 'f683ef76f06bb187cbed5546f6f28f28', // e.g only need xxxxx -> https://hm.baidu.com/hm.js?[xxxxx]
busuanzi: true, // see http://busuanzi.ibruce.info/
cnzzAnalytics: '' // 站长统计id only need xxxxxxxx -> https://s9.cnzz.com/z_stat.php?id=[xxxxxxxx]&web_id=[xxxxxxx]
},
comment: {
// support provider: gitalk, utterances, cusdis
@@ -58,7 +59,7 @@ const BLOG = {
},
isProd: process.env.VERCEL_ENV === 'production', // distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables)
googleAdsenseId: 'ca-pub-2708419466378217',
DaoVoiceId: 'daf1a94b' // DaoVoice http://dashboard.daovoice.io/get-started
DaoVoiceId: '' // 在线聊天 DaoVoice http://dashboard.daovoice.io/get-started
}
// export default BLOG
module.exports = BLOG

View File

@@ -13,12 +13,12 @@ const Footer = ({ fullWidth = true }) => {
<span id='busuanzi_container_site_pv' className='hidden'>
<a id='busuanzi_container_site_pv' target='_blank' className='fa fa-eye' rel='noreferrer'
href='https://www.cnzz.com/stat/website.php?web_id=1279970751'><span
href='/#'><span
id='busuanzi_value_site_pv' className='px-1'> </span>pv</a>
</span>
<span id='busuanzi_container_site_uv' className='pl-2 hidden'>
<a className='fa fa-user' rel='noreferrer' target='_blank'
href='http://tongji.baidu.com/web/10000363165/overview/index?siteId=16809429'>
href='/#'>
<span id='busuanzi_value_site_uv' className='px-1'> </span>uv</a>
</span>
<br/>

View File

@@ -1,5 +1,10 @@
import BLOG from '@/blog.config'
/**
* 第三方代码 统计脚本
* @returns {JSX.Element}
* @constructor
*/
const ThirdPartyScript = () => {
return (<>
{BLOG.DaoVoiceId && (<>
@@ -36,14 +41,14 @@ const ThirdPartyScript = () => {
/>
)}
{/* 百度统计 */}
{BLOG.analytics.baidyAnalytics && (
{BLOG.analytics.baiduAnalytics && (
<script async
dangerouslySetInnerHTML={{
__html: `
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?${BLOG.analytics.baidyAnalytics}";
hm.src = "https://hm.baidu.com/hm.js?${BLOG.analytics.baiduAnalytics}";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
@@ -59,11 +64,11 @@ const ThirdPartyScript = () => {
)}
{/* 站长统计 */}
{BLOG.isProd && (
{BLOG.analytics.cnzzAnalytics && (
<script async
dangerouslySetInnerHTML={{
__html: `
document.write(unescape("%3Cspan style='display:none' id='cnzz_stat_icon_1279970751'%3E%3C/span%3E%3Cscript src='https://s9.cnzz.com/z_stat.php%3Fid%3D1279970751' type='text/javascript'%3E%3C/script%3E"));
document.write(unescape("%3Cspan style='display:none' id='cnzz_stat_icon_${BLOG.analytics.cnzzAnalytics}'%3E%3C/span%3E%3Cscript src='https://s9.cnzz.com/z_stat.php%3Fid%3D${BLOG.analytics.cnzzAnalytics}' type='text/javascript'%3E%3C/script%3E"));
`
}}
/>

View File

@@ -91,7 +91,7 @@ const BlogPost = ({ post, blockMap, tags, prev, next }) => {
{/* 不蒜子 */}
<div id='busuanzi_container_page_pv' className='hidden'>
<a href='https://analytics.google.com/analytics/web/#/p273013569/reports/reportinghub'
<a href='/#'
className='fa fa-eye text-gray-500 text-sm leading-none py-1 px-2'>
&nbsp;<span id='busuanzi_value_page_pv' className='leading-6'></span>
</a>