feat: add umami config

This commit is contained in:
rizaldy 2024-01-31 03:08:52 +07:00
parent 9868e42f31
commit f8e6502a2a
2 changed files with 13 additions and 0 deletions

View File

@ -4,3 +4,7 @@ MINIO_SECRET_KEY=
MINIO_BUCKET= MINIO_BUCKET=
PEERTUBE_FEED_URL= PEERTUBE_FEED_URL=
UMAMI_ENABLED=
UMAMI_SCRIPT_URL=
UMAMI_WEBSITE_ID=

View File

@ -1,3 +1,5 @@
import Script from "next/script";
import { Html, Head, Main, NextScript } from "next/document"; import { Html, Head, Main, NextScript } from "next/document";
const Document = () => { const Document = () => {
@ -7,6 +9,13 @@ const Document = () => {
<body> <body>
<Main /> <Main />
<NextScript /> <NextScript />
{process.env.UMAMI_ENABLED === "true" ? (
<Script
strategy="lazyOnload"
src={process.env.UMAMI_SCRIPT_URL}
data-website-id={process.env.UMAMI_WEBSITE_ID}
/>
) : null}
</body> </body>
</Html> </Html>
); );