-
Notifications
You must be signed in to change notification settings - Fork 0
/
_document.tsx
58 lines (54 loc) · 1.47 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
50
51
52
53
54
55
56
57
58
import { Html, Head, Main, NextScript } from 'next/document'
import React from 'react'
import { GlobalSeoScript } from 'globalseo-next'
function GlobalSeoWithSubdomain() {
return (
<GlobalSeoScript
apiKey="YOUR_API_KEY"
originalLanguage="en"
allowedLanguages="en, es"
excludeClasses="class1, class2"
excludeIds="id1, id2"
translationMode="subdomain"
customLinks={{
'https://www.example.com/file_en.pdf': {
de: 'https://www.example.com/file_de.pdf',
fr: 'https://www.example.com/file_fr.pdf',
es: 'https://www.example.com/file_es.pdf',
},
'https://www.example.com/file_en.doc': {
de: 'https://www.example.com/file_de.doc',
fr: 'https://www.example.com/file_fr.doc',
es: 'https://www.example.com/file_es.doc',
},
}}
/>
)
}
function GlobalSeoClientSideOnly() {
return (
<GlobalSeoScript
apiKey="YOUR_API_KEY"
originalLanguage="en"
allowedLanguages="en, es"
excludeClasses="class1, class2"
excludeIds="id1, id2"
useBrowserLanguage="true"
translationMode='client_side_only'
/>
)
}
export default function Document() {
return (
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
{/* Add one, either with or without subdomain, don't add both! */}
<GlobalSeoWithSubdomain />
<GlobalSeoClientSideOnly />
</body>
</Html>
)
}