Skip to content

Commit 81cacd5

Browse files
committed
2 parents 6c6f895 + 265a828 commit 81cacd5

19 files changed

+836
-696
lines changed

.env.local

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables
2-
NEXT_PUBLIC_VERSION=4.5.1
2+
NEXT_PUBLIC_VERSION=4.5.2
33

44

55
# 可在此添加环境变量,去掉最左边的(# )注释即可

components/ExternalPlugins.js

+69-61
Original file line numberDiff line numberDiff line change
@@ -6,71 +6,12 @@ import TianLiGPT from './TianliGPT'
66
import WebWhiz from './Webwhiz'
77

88
import { CUSTOM_EXTERNAL_CSS, CUSTOM_EXTERNAL_JS } from '@/blog.config'
9+
import { mapPageUrl } from '@/lib/notion/mapPageUrl'
910
import { isBrowser, loadExternalResource } from '@/lib/utils'
11+
import { useRouter } from 'next/router'
1012
import { useEffect } from 'react'
1113
import { initGoogleAdsense } from './GoogleAdsense'
1214

13-
const TwikooCommentCounter = dynamic(
14-
() => import('@/components/TwikooCommentCounter'),
15-
{ ssr: false }
16-
)
17-
const DebugPanel = dynamic(() => import('@/components/DebugPanel'), {
18-
ssr: false
19-
})
20-
const ThemeSwitch = dynamic(() => import('@/components/ThemeSwitch'), {
21-
ssr: false
22-
})
23-
const Fireworks = dynamic(() => import('@/components/Fireworks'), {
24-
ssr: false
25-
})
26-
const MouseFollow = dynamic(() => import('@/components/MouseFollow'), {
27-
ssr: false
28-
})
29-
const Nest = dynamic(() => import('@/components/Nest'), { ssr: false })
30-
const FlutteringRibbon = dynamic(
31-
() => import('@/components/FlutteringRibbon'),
32-
{ ssr: false }
33-
)
34-
const Ribbon = dynamic(() => import('@/components/Ribbon'), { ssr: false })
35-
const Sakura = dynamic(() => import('@/components/Sakura'), { ssr: false })
36-
const StarrySky = dynamic(() => import('@/components/StarrySky'), {
37-
ssr: false
38-
})
39-
const DifyChatbot = dynamic(() => import('@/components/DifyChatbot'), {
40-
ssr: false
41-
})
42-
const Analytics = dynamic(
43-
() =>
44-
import('@vercel/analytics/react').then(async m => {
45-
return m.Analytics
46-
}),
47-
{ ssr: false }
48-
)
49-
const MusicPlayer = dynamic(() => import('@/components/Player'), { ssr: false })
50-
const Ackee = dynamic(() => import('@/components/Ackee'), { ssr: false })
51-
const Gtag = dynamic(() => import('@/components/Gtag'), { ssr: false })
52-
const Busuanzi = dynamic(() => import('@/components/Busuanzi'), { ssr: false })
53-
const Messenger = dynamic(() => import('@/components/FacebookMessenger'), {
54-
ssr: false
55-
})
56-
const VConsole = dynamic(() => import('@/components/VConsole'), { ssr: false })
57-
const CustomContextMenu = dynamic(
58-
() => import('@/components/CustomContextMenu'),
59-
{ ssr: false }
60-
)
61-
const DisableCopy = dynamic(() => import('@/components/DisableCopy'), {
62-
ssr: false
63-
})
64-
const AdBlockDetect = dynamic(() => import('@/components/AdBlockDetect'), {
65-
ssr: false
66-
})
67-
const LoadingProgress = dynamic(() => import('@/components/LoadingProgress'), {
68-
ssr: false
69-
})
70-
const AosAnimation = dynamic(() => import('@/components/AOSAnimation'), {
71-
ssr: false
72-
})
73-
7415
/**
7516
* 各种插件脚本
7617
* @param {*} props
@@ -155,6 +96,7 @@ const ExternalPlugin = props => {
15596
}
15697
}
15798

99+
const router = useRouter()
158100
useEffect(() => {
159101
// 异步渲染谷歌广告
160102
if (ADSENSE_GOOGLE_ID) {
@@ -163,6 +105,11 @@ const ExternalPlugin = props => {
163105
}, 1000)
164106
}
165107

108+
// 映射url
109+
mapPageUrl(props?.allNavPages)
110+
}, [router])
111+
112+
useEffect(() => {
166113
// 执行注入脚本
167114
// eslint-disable-next-line no-eval
168115
eval(GLOBAL_JS)
@@ -389,4 +336,65 @@ const ExternalPlugin = props => {
389336
)
390337
}
391338

339+
const TwikooCommentCounter = dynamic(
340+
() => import('@/components/TwikooCommentCounter'),
341+
{ ssr: false }
342+
)
343+
const DebugPanel = dynamic(() => import('@/components/DebugPanel'), {
344+
ssr: false
345+
})
346+
const ThemeSwitch = dynamic(() => import('@/components/ThemeSwitch'), {
347+
ssr: false
348+
})
349+
const Fireworks = dynamic(() => import('@/components/Fireworks'), {
350+
ssr: false
351+
})
352+
const MouseFollow = dynamic(() => import('@/components/MouseFollow'), {
353+
ssr: false
354+
})
355+
const Nest = dynamic(() => import('@/components/Nest'), { ssr: false })
356+
const FlutteringRibbon = dynamic(
357+
() => import('@/components/FlutteringRibbon'),
358+
{ ssr: false }
359+
)
360+
const Ribbon = dynamic(() => import('@/components/Ribbon'), { ssr: false })
361+
const Sakura = dynamic(() => import('@/components/Sakura'), { ssr: false })
362+
const StarrySky = dynamic(() => import('@/components/StarrySky'), {
363+
ssr: false
364+
})
365+
const DifyChatbot = dynamic(() => import('@/components/DifyChatbot'), {
366+
ssr: false
367+
})
368+
const Analytics = dynamic(
369+
() =>
370+
import('@vercel/analytics/react').then(async m => {
371+
return m.Analytics
372+
}),
373+
{ ssr: false }
374+
)
375+
const MusicPlayer = dynamic(() => import('@/components/Player'), { ssr: false })
376+
const Ackee = dynamic(() => import('@/components/Ackee'), { ssr: false })
377+
const Gtag = dynamic(() => import('@/components/Gtag'), { ssr: false })
378+
const Busuanzi = dynamic(() => import('@/components/Busuanzi'), { ssr: false })
379+
const Messenger = dynamic(() => import('@/components/FacebookMessenger'), {
380+
ssr: false
381+
})
382+
const VConsole = dynamic(() => import('@/components/VConsole'), { ssr: false })
383+
const CustomContextMenu = dynamic(
384+
() => import('@/components/CustomContextMenu'),
385+
{ ssr: false }
386+
)
387+
const DisableCopy = dynamic(() => import('@/components/DisableCopy'), {
388+
ssr: false
389+
})
390+
const AdBlockDetect = dynamic(() => import('@/components/AdBlockDetect'), {
391+
ssr: false
392+
})
393+
const LoadingProgress = dynamic(() => import('@/components/LoadingProgress'), {
394+
ssr: false
395+
})
396+
const AosAnimation = dynamic(() => import('@/components/AOSAnimation'), {
397+
ssr: false
398+
})
399+
392400
export default ExternalPlugin

0 commit comments

Comments
 (0)