Add Plausible

This commit is contained in:
Marcus Blättermann 2022-12-14 22:42:25 +01:00
parent 8c61ddef76
commit c9da1af0e0
No known key found for this signature in database
GPG Key ID: A1E1F04008AC450D
3 changed files with 25 additions and 2 deletions

View File

@ -31,6 +31,7 @@
"md-attr-parser": "^1.3.0", "md-attr-parser": "^1.3.0",
"next": "13.0.2", "next": "13.0.2",
"next-mdx-remote": "^4.2.0", "next-mdx-remote": "^4.2.0",
"next-plausible": "^3.6.5",
"next-pwa": "^5.6.0", "next-pwa": "^5.6.0",
"next-sitemap": "^3.1.32", "next-sitemap": "^3.1.32",
"node-fetch": "^2.6.7", "node-fetch": "^2.6.7",
@ -8487,6 +8488,19 @@
"react-dom": ">=16.x <=18.x" "react-dom": ">=16.x <=18.x"
} }
}, },
"node_modules/next-plausible": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/next-plausible/-/next-plausible-3.6.5.tgz",
"integrity": "sha512-eGsyie68xIyX+If1PSIJsgv7pkiMUm66Yt9gELl3kUvljaxoJOCwUEALGk5JHvhByGsBiRswkrGioDMthL3gfQ==",
"funding": {
"url": "https://github.com/4lejandrito/next-plausible?sponsor=1"
},
"peerDependencies": {
"next": "^11.1.0 || ^12.0.0 || ^13.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
},
"node_modules/next-pwa": { "node_modules/next-pwa": {
"version": "5.6.0", "version": "5.6.0",
"resolved": "https://registry.npmjs.org/next-pwa/-/next-pwa-5.6.0.tgz", "resolved": "https://registry.npmjs.org/next-pwa/-/next-pwa-5.6.0.tgz",
@ -18122,6 +18136,12 @@
"vfile-matter": "^3.0.1" "vfile-matter": "^3.0.1"
} }
}, },
"next-plausible": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/next-plausible/-/next-plausible-3.6.5.tgz",
"integrity": "sha512-eGsyie68xIyX+If1PSIJsgv7pkiMUm66Yt9gELl3kUvljaxoJOCwUEALGk5JHvhByGsBiRswkrGioDMthL3gfQ==",
"requires": {}
},
"next-pwa": { "next-pwa": {
"version": "5.6.0", "version": "5.6.0",
"resolved": "https://registry.npmjs.org/next-pwa/-/next-pwa-5.6.0.tgz", "resolved": "https://registry.npmjs.org/next-pwa/-/next-pwa-5.6.0.tgz",

View File

@ -35,6 +35,7 @@
"md-attr-parser": "^1.3.0", "md-attr-parser": "^1.3.0",
"next": "13.0.2", "next": "13.0.2",
"next-mdx-remote": "^4.2.0", "next-mdx-remote": "^4.2.0",
"next-plausible": "^3.6.5",
"next-pwa": "^5.6.0", "next-pwa": "^5.6.0",
"next-sitemap": "^3.1.32", "next-sitemap": "^3.1.32",
"node-fetch": "^2.6.7", "node-fetch": "^2.6.7",

View File

@ -1,12 +1,14 @@
import '../src/styles/layout.sass' import '../src/styles/layout.sass'
import type { AppProps } from 'next/app' import type { AppProps } from 'next/app'
import Head from 'next/head' import Head from 'next/head'
import PlausibleProvider from 'next-plausible'
import { MDXProvider } from '@mdx-js/react' import { MDXProvider } from '@mdx-js/react'
import { remarkComponents } from '../src/remark' import { remarkComponents } from '../src/remark'
import { domain } from '../meta/dynamicMeta.mjs'
export default function App({ Component, pageProps }: AppProps) { export default function App({ Component, pageProps }: AppProps) {
return ( return (
<> <PlausibleProvider domain={domain} enabled>
<Head> <Head>
<link rel="sitemap" type="application/xml" href="/sitemap.xml" /> <link rel="sitemap" type="application/xml" href="/sitemap.xml" />
<link rel="shortcut icon" href="/icons/icon-192x192.png" /> <link rel="shortcut icon" href="/icons/icon-192x192.png" />
@ -24,6 +26,6 @@ export default function App({ Component, pageProps }: AppProps) {
<MDXProvider components={remarkComponents}> <MDXProvider components={remarkComponents}>
<Component {...pageProps} /> <Component {...pageProps} />
</MDXProvider> </MDXProvider>
</> </PlausibleProvider>
) )
} }