Merge pull request #2996 from tangly1024/feat/minify

Feat/minify
This commit is contained in:
tangly1024
2024-11-19 23:02:17 +08:00
committed by GitHub
2 changed files with 18 additions and 6 deletions

View File

@@ -4,11 +4,9 @@ import { isBrowser, loadExternalResource } from '@/lib/utils'
import dynamic from 'next/dynamic'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import Coze from './Coze'
import { GlobalStyle } from './GlobalStyle'
import { initGoogleAdsense } from './GoogleAdsense'
import LA51 from './LA51'
import TianLiGPT from './TianliGPT'
import WebWhiz from './Webwhiz'
/**
@@ -148,7 +146,7 @@ const ExternalPlugin = props => {
{!CAN_COPY && <DisableCopy />}
{WEB_WHIZ_ENABLED && <WebWhiz />}
{AD_WWADS_BLOCK_DETECT && <AdBlockDetect />}
{TIANLI_KEY && <TianLiGPT />}
{TIANLI_KEY && <TianliGPT />}
<VConsole />
{ENABLE_NPROGRSS && <LoadingProgress />}
<AosAnimation />
@@ -427,4 +425,14 @@ const AosAnimation = dynamic(() => import('@/components/AOSAnimation'), {
ssr: false
})
const Coze = dynamic(() => import('@/components/Coze'), {
ssr: false
})
const LA51 = dynamic(() => import('@/components/LA51'), {
ssr: false
})
const TianliGPT = dynamic(() => import('@/components/TianliGPT'), {
ssr: false
})
export default ExternalPlugin

View File

@@ -34,6 +34,10 @@ export async function getGlobalData({
const siteIds = pageId?.split(',') || []
let data = EmptyData(pageId)
if (BLOG.BUNDLE_ANALYZER) {
return data
}
try {
for (let index = 0; index < siteIds.length; index++) {
const siteId = siteIds[index]
@@ -97,10 +101,10 @@ const EmptyData = pageId => {
id: 1,
title: `无法获取Notion数据请检查Notion_ID \n 当前 ${pageId}`,
summary:
'访问文档获取帮助→ https://tangly1024.com/article/vercel-deploy-notion-next',
'访问文档获取帮助 → https://docs.tangly1024.com/article/vercel-deploy-notion-next',
status: 'Published',
type: 'Post',
slug: '13a171332816461db29d50e9f575b00d',
slug: 'oops',
publishDay: '2024-11-13',
pageCoverThumbnail: BLOG.HOME_BANNER_IMAGE,
date: {