mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-22 07:26:48 +00:00
feat: 更好的自定义字体配置
This commit is contained in:
@@ -19,7 +19,6 @@ import { GlobalContextProvider } from '@/lib/global'
|
||||
import { DebugPanel } from '@/components/DebugPanel'
|
||||
import { ThemeSwitch } from '@/components/ThemeSwitch'
|
||||
import { Fireworks } from '@/components/Fireworks'
|
||||
import TailwindCustomCssInit from '@/components/TailwindCustomCssInit'
|
||||
|
||||
const Ackee = dynamic(() => import('@/components/Ackee'), { ssr: false })
|
||||
const Gtag = dynamic(() => import('@/components/Gtag'), { ssr: false })
|
||||
@@ -34,7 +33,6 @@ const Messenger = dynamic(() => import('@/components/FacebookMessenger'), {
|
||||
const MyApp = ({ Component, pageProps }) => {
|
||||
// 外部插件
|
||||
const externalPlugins = <>
|
||||
<TailwindCustomCssInit/>
|
||||
{JSON.parse(BLOG.THEME_SWITCH) && <ThemeSwitch />}
|
||||
{JSON.parse(BLOG.DEBUG) && <DebugPanel />}
|
||||
{BLOG.ANALYTICS_ACKEE_TRACKER && <Ackee />}
|
||||
|
||||
@@ -4,25 +4,28 @@ import BLOG from '@/blog.config'
|
||||
import CommonScript from '@/components/CommonScript'
|
||||
|
||||
class MyDocument extends Document {
|
||||
static async getInitialProps (ctx) {
|
||||
static async getInitialProps(ctx) {
|
||||
const initialProps = await Document.getInitialProps(ctx)
|
||||
return { ...initialProps }
|
||||
}
|
||||
|
||||
render () {
|
||||
render() {
|
||||
return (
|
||||
<Html lang={BLOG.LANG} className='test'>
|
||||
<Head>
|
||||
<link rel='icon' href='/favicon.ico' />
|
||||
<link rel='icon' href='/favicon.svg' type='image/svg+xml' />
|
||||
{/* 谷歌字体镜像 */}
|
||||
<link href={`${BLOG.FONT_URL}`} rel="stylesheet"/>
|
||||
{BLOG.CUSTOM_FONT
|
||||
? <link href='https://fonts.font.im/css2?family=Noto+Serif+SC&display=swap' rel='stylesheet' />
|
||||
: BLOG.CUSTOM_FONT_URL?.map(fontUrl =>
|
||||
<link href={`${fontUrl}`} key={fontUrl} rel='stylesheet' />)}
|
||||
<CommonScript />
|
||||
</Head>
|
||||
|
||||
<body className={`${BLOG.FONT} tracking-wider subpixel-antialiased bg-day dark:bg-night`}>
|
||||
<Main />
|
||||
<NextScript />
|
||||
<Main />
|
||||
<NextScript />
|
||||
</body>
|
||||
</Html>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user