-
Notifications
You must be signed in to change notification settings - Fork 0
/
layout.tsx
79 lines (73 loc) · 1.94 KB
/
layout.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import { GlobalSeoScript } from "globalseo-next";
const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
});
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
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 RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
{/* Add one, either with or without subdomain, don't add both! */}
<GlobalSeoWithSubdomain />
<GlobalSeoClientSideOnly />
</body>
</html>
);
}