mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 23:16:49 +00:00
44 lines
1.0 KiB
JavaScript
44 lines
1.0 KiB
JavaScript
// eslint-disable-next-line @next/next/no-document-import-in-page
|
|
import BLOG from '@/blog.config'
|
|
import Document, { Head, Html, Main, NextScript } from 'next/document'
|
|
|
|
class MyDocument extends Document {
|
|
static async getInitialProps(ctx) {
|
|
const initialProps = await Document.getInitialProps(ctx)
|
|
return { ...initialProps }
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<Html lang={BLOG.LANG}>
|
|
<Head>
|
|
{/* 预加载字体 */}
|
|
{BLOG.FONT_AWESOME && (
|
|
<>
|
|
<link
|
|
rel='preload'
|
|
href={BLOG.FONT_AWESOME}
|
|
as='style'
|
|
crossOrigin='anonymous'
|
|
/>
|
|
<link
|
|
rel='stylesheet'
|
|
href={BLOG.FONT_AWESOME}
|
|
crossOrigin='anonymous'
|
|
referrerPolicy='no-referrer'
|
|
/>
|
|
</>
|
|
)}
|
|
</Head>
|
|
|
|
<body>
|
|
<Main />
|
|
<NextScript />
|
|
</body>
|
|
</Html>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default MyDocument
|