|
1 | | -import BaiDuAnalytics from '@/app/BaiDuAnalytics'; |
2 | | -import ClarityAnalytics from '@/app/ClarityAnalytics'; |
3 | | -import RybbitAnalytics from '@/app/RybbitAnalytics'; |
4 | | -import GoogleAnalytics from '@/app/GoogleAnalytics'; |
5 | | -// import { TailwindIndicator } from '@/components/TailwindIndicator'; |
6 | | -import { ThemeProvider } from '@/components/ThemeProvider'; |
7 | | -import { siteConfig } from '@/config/site'; |
8 | | -import { defaultLocale } from '@/lib/i18n'; |
9 | | -import { cn } from '@/lib/utils'; |
10 | | -import '@/styles/globals.css'; |
11 | | -import '@/styles/loading.css'; |
12 | | -import '@/styles/plyr.css'; |
13 | | -import { Analytics } from '@vercel/analytics/react'; |
14 | | -import { Viewport } from 'next'; |
15 | | -import { Inter as FontSans } from 'next/font/google'; |
16 | | -import Script from 'next/script'; |
17 | | - |
18 | | -const fontSans = FontSans({ |
19 | | - subsets: ['latin'], |
20 | | - variable: '--font-sans' |
21 | | -}); |
22 | | - |
23 | | -export const metadata = { |
24 | | - title: siteConfig.name, |
25 | | - description: siteConfig.description, |
26 | | - keywords: siteConfig.keywords, |
27 | | - authors: siteConfig.authors, |
28 | | - creator: siteConfig.creator, |
29 | | - icons: siteConfig.icons, |
30 | | - metadataBase: siteConfig.metadataBase, |
31 | | - openGraph: siteConfig.openGraph, |
32 | | - twitter: siteConfig.twitter, |
33 | | - other: { |
34 | | - 'baidu-site-verification': process.env.NEXT_PUBLIC_BAIDU_KEY |
35 | | - ? process.env.NEXT_PUBLIC_BAIDU_KEY |
36 | | - : '' |
37 | | - } |
38 | | -}; |
39 | | -export const viewport: Viewport = { |
40 | | - themeColor: siteConfig.themeColors |
41 | | -}; |
42 | | - |
43 | | -export default async function RootLayout({ |
44 | | - children, |
45 | | - params: { lang } |
46 | | -}: { |
47 | | - children: React.ReactNode; |
48 | | - params: { lang: string[] | undefined }; |
49 | | -}) { |
50 | | - const isChineseDomain = process.env.NEXT_PUBLIC_USER_URL?.includes('.cn') |
51 | | - |
52 | | - return ( |
53 | | - <html lang={(lang && lang[0]) || defaultLocale} suppressHydrationWarning> |
54 | | - <head> |
55 | | - {!isChineseDomain && ( |
56 | | - <Script |
57 | | - id="gtm-script" |
58 | | - strategy="afterInteractive" |
59 | | - dangerouslySetInnerHTML={{ |
60 | | - __html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': |
61 | | - new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], |
62 | | - j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
63 | | - 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
64 | | - })(window,document,'script','dataLayer','GTM-W9HPZZ22');` |
65 | | - }} |
66 | | - /> |
67 | | - )} |
68 | | - </head> |
69 | | - <body className={cn('min-h-screen font-sans antialiased', fontSans.variable)}> |
70 | | - {!isChineseDomain && ( |
71 | | - <noscript> |
72 | | - <iframe |
73 | | - src="https://www.googletagmanager.com/ns.html?id=GTM-W9HPZZ22" |
74 | | - height="0" |
75 | | - width="0" |
76 | | - style={{ display: 'none', visibility: 'hidden' }} |
77 | | - ></iframe> |
78 | | - </noscript> |
79 | | - )} |
80 | | - <ThemeProvider attribute="class" defaultTheme={siteConfig.nextThemeColor} enableSystem> |
81 | | - {children} |
82 | | - {/* <Footer /> */} |
83 | | - <Analytics /> |
84 | | - {/* <TailwindIndicator /> */} |
85 | | - </ThemeProvider> |
86 | | - <GoogleAnalytics /> |
87 | | - <BaiDuAnalytics /> |
88 | | - <ClarityAnalytics /> |
89 | | - <RybbitAnalytics /> |
90 | | - </body> |
91 | | - </html> |
92 | | - ); |
93 | | -} |
| 1 | +import BaiDuAnalytics from '@/app/BaiDuAnalytics'; |
| 2 | +import ClarityAnalytics from '@/app/ClarityAnalytics'; |
| 3 | +import RybbitAnalytics from '@/app/RybbitAnalytics'; |
| 4 | +import GoogleAnalytics from '@/app/GoogleAnalytics'; |
| 5 | +// import { TailwindIndicator } from '@/components/TailwindIndicator'; |
| 6 | +import { ThemeProvider } from '@/components/ThemeProvider'; |
| 7 | +import { siteConfig } from '@/config/site'; |
| 8 | +import { defaultLocale } from '@/lib/i18n'; |
| 9 | +import { cn } from '@/lib/utils'; |
| 10 | +import '@/styles/globals.css'; |
| 11 | +import '@/styles/loading.css'; |
| 12 | +import '@/styles/plyr.css'; |
| 13 | +import { Analytics } from '@vercel/analytics/react'; |
| 14 | +import { Viewport } from 'next'; |
| 15 | +import { Inter as FontSans } from 'next/font/google'; |
| 16 | +import Script from 'next/script'; |
| 17 | + |
| 18 | +const fontSans = FontSans({ |
| 19 | + subsets: ['latin'], |
| 20 | + variable: '--font-sans' |
| 21 | +}); |
| 22 | + |
| 23 | +export const metadata = { |
| 24 | + title: siteConfig.name, |
| 25 | + description: siteConfig.description, |
| 26 | + keywords: siteConfig.keywords, |
| 27 | + authors: siteConfig.authors, |
| 28 | + creator: siteConfig.creator, |
| 29 | + icons: siteConfig.icons, |
| 30 | + metadataBase: siteConfig.metadataBase, |
| 31 | + openGraph: siteConfig.openGraph, |
| 32 | + twitter: siteConfig.twitter, |
| 33 | + other: { |
| 34 | + 'baidu-site-verification': process.env.NEXT_PUBLIC_BAIDU_KEY |
| 35 | + ? process.env.NEXT_PUBLIC_BAIDU_KEY |
| 36 | + : '' |
| 37 | + } |
| 38 | +}; |
| 39 | +export const viewport: Viewport = { |
| 40 | + themeColor: siteConfig.themeColors |
| 41 | +}; |
| 42 | + |
| 43 | +export default async function RootLayout({ |
| 44 | + children, |
| 45 | + params: { lang } |
| 46 | +}: { |
| 47 | + children: React.ReactNode; |
| 48 | + params: { lang: string[] | undefined }; |
| 49 | +}) { |
| 50 | + const isChineseDomain = process.env.NEXT_PUBLIC_USER_URL?.includes('.cn') |
| 51 | + |
| 52 | + return ( |
| 53 | + <html lang={(lang && lang[0]) || defaultLocale} suppressHydrationWarning> |
| 54 | + <head> |
| 55 | + {!isChineseDomain && ( |
| 56 | + <Script |
| 57 | + id="gtm-script" |
| 58 | + strategy="afterInteractive" |
| 59 | + dangerouslySetInnerHTML={{ |
| 60 | + __html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': |
| 61 | + new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], |
| 62 | + j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
| 63 | + 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
| 64 | + })(window,document,'script','dataLayer','GTM-W9HPZZ22');` |
| 65 | + }} |
| 66 | + /> |
| 67 | + )} |
| 68 | + </head> |
| 69 | + <body className={cn('min-h-screen font-sans antialiased', fontSans.variable)}> |
| 70 | + {!isChineseDomain && ( |
| 71 | + <noscript> |
| 72 | + <iframe |
| 73 | + src="https://www.googletagmanager.com/ns.html?id=GTM-W9HPZZ22" |
| 74 | + height="0" |
| 75 | + width="0" |
| 76 | + style={{ display: 'none', visibility: 'hidden' }} |
| 77 | + ></iframe> |
| 78 | + </noscript> |
| 79 | + )} |
| 80 | + <ThemeProvider attribute="class" defaultTheme={siteConfig.nextThemeColor} enableSystem={false} forcedTheme="dark"> |
| 81 | + {children} |
| 82 | + {/* <Footer /> */} |
| 83 | + <Analytics /> |
| 84 | + {/* <TailwindIndicator /> */} |
| 85 | + </ThemeProvider> |
| 86 | + <GoogleAnalytics /> |
| 87 | + <BaiDuAnalytics /> |
| 88 | + <ClarityAnalytics /> |
| 89 | + <RybbitAnalytics /> |
| 90 | + </body> |
| 91 | + </html> |
| 92 | + ); |
| 93 | +} |
0 commit comments