-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_document.tsx
49 lines (45 loc) · 1.39 KB
/
_document.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// eslint-disable-next-line @next/next/no-document-import-in-page
import Document, {
Html,
Head,
Main,
NextScript,
DocumentContext,
DocumentProps,
} from "next/document";
// eslint-disable-next-line @next/next/no-document-import-in-page
import Script from "next/script";
type Props = DocumentProps & {
// add custom document props
};
class MyDocument extends Document<Props> {
static async getInitialProps(ctx: DocumentContext) {
const initialProps = await Document.getInitialProps(ctx);
return { ...initialProps, locale: ctx?.locale || "en" };
}
render() {
return (
<Html lang={this.props.locale}>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Karla:ital,wght@0,200..800;1,200..800&display=swap"
rel="stylesheet"
/>
<Head>
<meta charSet="utf-8" />
<title> My Portoflio </title>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}
export default MyDocument;