Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Commit

Permalink
feat: add vercel analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-bell committed Nov 5, 2022
1 parent d2811dc commit b43acb0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@docusaurus/theme-common": "2.0.1",
"@mdx-js/react": "1.6.22",
"@svgr/webpack": "6.2.1",
"@vercel/analytics": "0.1.3",
"clsx": "1.1.1",
"file-loader": "6.2.0",
"prism-react-renderer": "1.3.3",
Expand Down
14 changes: 4 additions & 10 deletions docs/src/theme/Root.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React from "react";
import Head from "@docusaurus/Head";
import { useThemeConfig } from "@docusaurus/theme-common";
import { domain, isProduction, withUrl } from "../utils";
import { withUrl } from "../utils";
import { inject } from "@vercel/analytics";

function CustomRoot({ children }) {
inject();

const { metaTags } = useThemeConfig();

const title = metaTags.find((item) => item.name === "data-title").content;
Expand All @@ -15,15 +18,6 @@ function CustomRoot({ children }) {

<link rel="apple-touch-icon" href="/assets/img/favicon@192px.png" />
<meta name="apple-mobile-web-app-title" content={title} />

{isProduction && (
<script
async
defer
data-domain={domain}
src="https://plausible.io/js/plausible.js"
/>
)}
</Head>

{children}
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b43acb0

Please sign in to comment.