mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
Merge pull request #1701 from tangly1024/feat/51la-analytics
feat-51la-analytics
This commit is contained in:
@@ -324,6 +324,10 @@ const BLOG = {
|
||||
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]
|
||||
ANALYTICS_GOOGLE_ID: process.env.NEXT_PUBLIC_ANALYTICS_GOOGLE_ID || '', // 谷歌Analytics的id e.g: G-XXXXXXXXXX
|
||||
|
||||
// 51la 站点统计 https://www.51.la/
|
||||
ANALYTICS_51LA_ID: process.env.NEXT_PUBLIC_ANALYTICS_51LA_ID || '', // id,在51la后台获取 参阅 https://docs.tangly1024.com/article/notion-next-51-la
|
||||
ANALYTICS_51LA_CK: process.env.NEXT_PUBLIC_ANALYTICS_51LA_CK || '', // ck,在51la后台获取
|
||||
|
||||
// Matomo 网站统计
|
||||
MATOMO_HOST_URL: process.env.NEXT_PUBLIC_MATOMO_HOST_URL || '', // Matomo服务器地址,不带斜杠
|
||||
MATOMO_SITE_ID: process.env.NEXT_PUBLIC_MATOMO_SITE_ID || '', // Matomo网站ID
|
||||
@@ -405,7 +409,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, // 编译时是否展示内容
|
||||
BUNDLE_ANALYZER: process.env.ANALYZE === 'true' || false, // 是否展示编译依赖内容与大小
|
||||
VERSION: process.env.NEXT_PUBLIC_VERSION // 版本号
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ const ExternalPlugin = (props) => {
|
||||
const ANALYTICS_GOOGLE_ID = siteConfig('ANALYTICS_GOOGLE_ID')
|
||||
const MATOMO_HOST_URL = siteConfig('MATOMO_HOST_URL')
|
||||
const MATOMO_SITE_ID = siteConfig('MATOMO_SITE_ID')
|
||||
const ANALYTICS_51LA_ID = siteConfig('ANALYTICS_51LA_ID')
|
||||
const ANALYTICS_51LA_CK = siteConfig('ANALYTICS_51LA_CK')
|
||||
|
||||
if (DISABLE_PLUGIN) {
|
||||
return null
|
||||
@@ -96,6 +98,15 @@ const ExternalPlugin = (props) => {
|
||||
<LoadingProgress />
|
||||
<AosAnimation />
|
||||
|
||||
{ANALYTICS_51LA_ID && ANALYTICS_51LA_CK && (<>
|
||||
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js" defer/>
|
||||
<script async dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
LA.init({id:"${ANALYTICS_51LA_ID}",ck:"${ANALYTICS_51LA_CK}",hashMode:true})
|
||||
`
|
||||
}} />
|
||||
</>)}
|
||||
|
||||
{CHATBASE_ID && (<>
|
||||
<script id={CHATBASE_ID} src="https://www.chatbase.co/embed.min.js" defer />
|
||||
<script async dangerouslySetInnerHTML={{
|
||||
|
||||
Reference in New Issue
Block a user