mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
Update _app.js
This commit is contained in:
@@ -9,7 +9,6 @@ import '@/styles/notion.css' // 重写部分样式
|
||||
import 'aos/dist/aos.css' // You can also use <link> for styles
|
||||
|
||||
import { GlobalContextProvider } from '@/lib/global'
|
||||
import { isBrowser, loadExternalResource } from '@/lib/utils'
|
||||
import { getGlobalLayoutByTheme } from '@/themes/theme'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useCallback, useMemo } from 'react'
|
||||
@@ -17,7 +16,7 @@ import { getQueryParam } from '../lib/utils'
|
||||
|
||||
// 各种扩展插件 这个要阻塞引入
|
||||
import ExternalPlugins from '@/components/ExternalPlugins'
|
||||
import { CUSTOM_EXTERNAL_CSS, CUSTOM_EXTERNAL_JS, IMG_SHADOW, THEME } from '@/blog.config'
|
||||
import { THEME } from '@/blog.config'
|
||||
|
||||
const MyApp = ({ Component, pageProps }) => {
|
||||
/**
|
||||
@@ -39,33 +38,6 @@ const MyApp = ({ Component, pageProps }) => {
|
||||
[queryParam]
|
||||
)
|
||||
|
||||
// 自定义样式css和js引入
|
||||
if (isBrowser) {
|
||||
// 初始化AOS动画
|
||||
// 静态导入本地自定义样式
|
||||
loadExternalResource('/css/custom.css', 'css')
|
||||
loadExternalResource('/js/custom.js', 'js')
|
||||
|
||||
// 自动添加图片阴影
|
||||
if (IMG_SHADOW) {
|
||||
loadExternalResource('/css/img-shadow.css', 'css')
|
||||
}
|
||||
|
||||
// 导入外部自定义脚本
|
||||
if (CUSTOM_EXTERNAL_JS && CUSTOM_EXTERNAL_JS.length > 0) {
|
||||
for (const url of CUSTOM_EXTERNAL_JS) {
|
||||
loadExternalResource(url, 'js')
|
||||
}
|
||||
}
|
||||
|
||||
// 导入外部自定义样式
|
||||
if (CUSTOM_EXTERNAL_CSS && CUSTOM_EXTERNAL_CSS.length > 0) {
|
||||
for (const url of CUSTOM_EXTERNAL_CSS) {
|
||||
loadExternalResource(url, 'css')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<GlobalContextProvider {...pageProps}>
|
||||
<GLayout {...pageProps}>
|
||||
|
||||
Reference in New Issue
Block a user