Clear warning about styleSheet declare in Page level, move it to _document.js

This commit is contained in:
Tuan Cao 2022-03-23 11:21:59 +07:00
parent 0be9ae3ff3
commit ea1c149a1f
3 changed files with 18 additions and 12 deletions

View File

@ -6,12 +6,6 @@ export default function Layout({children, home}) {
return (
<div>
<Head>
<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin/>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800;900&display=swap"
rel="stylesheet"/>
</Head>
<main className="markdown-rendered theme-light">{children}</main>
</div>
)

18
pages/_document.js Normal file
View File

@ -0,0 +1,18 @@
import { Html, Head, Main, NextScript } from 'next/document'
export default function Document() {
return (
<Html>
<Head>
<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="true"/>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800;900&display=swap"
rel="stylesheet"/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}

View File

@ -9,12 +9,6 @@ export default function Home({content, graphdata, filenames, directoryTree, ...p
return (
<Layout home>
<Head>
<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin/>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800;900&display=swap"
rel="stylesheet"/>
</Head>
<section>
{/*<BasicTree directoryTree/>*/}
<div dangerouslySetInnerHTML={{__html: content.data}}/>