Skip to content
This repository was archived by the owner on Nov 2, 2024. It is now read-only.

Commit ab93193

Browse files
committed
fix: update
Signed-off-by: Innei <[email protected]>
1 parent 3dd7a1e commit ab93193

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

pages/_app.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import Script from 'next/script'
2-
import '../public/style.css'
31
import { OpenpanelProvider } from '@openpanel/nextjs'
4-
import Head from 'next/head'
2+
import '../public/style.css'
53

64
export default function App({ Component, pageProps }) {
75
return (
@@ -12,13 +10,7 @@ export default function App({ Component, pageProps }) {
1210
trackScreenViews={true}
1311
trackOutgoingLinks={true}
1412
/>
15-
<Head>
16-
<Script>{`(function(c,l,a,r,i,t,y){
17-
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
18-
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
19-
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
20-
})(window, document, "clarity", "script", "lsoepndf05");`}</Script>
21-
</Head>
13+
2214
<Component {...pageProps} />
2315
</>
2416
)

pages/_document.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import Document, { Head, Html, Main, NextScript } from 'next/document'
2+
import Script from 'next/script'
3+
4+
export default class MyDocument extends Document {
5+
render() {
6+
return (
7+
<Html lang="zh-cn">
8+
<Head>
9+
<meta charSet="UTF-8" />
10+
11+
<meta name="mobile-web-app-capable" content="yes" />
12+
<meta name="apple-mobile-web-app-capable" content="yes" />
13+
14+
<meta name="apple-mobile-web-app-capable" content="yes" />
15+
16+
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
17+
18+
<script
19+
dangerouslySetInnerHTML={{
20+
__html: `(function(c,l,a,r,i,t,y){
21+
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
22+
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
23+
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
24+
})(window, document, "clarity", "script", "lsoepndf05");`,
25+
}}
26+
></script>
27+
</Head>
28+
29+
<body>
30+
<Main />
31+
<NextScript />
32+
</body>
33+
</Html>
34+
)
35+
}
36+
}

0 commit comments

Comments
 (0)