From f1d3b5e162a616c560c605b76c3f9feb6d938dc3 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sat, 9 Nov 2024 03:09:09 -0800 Subject: [PATCH] add analytics --- default.nix | 5 +++-- src/components/Analytics.astro | 4 ++++ src/config/Head.astro | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/components/Analytics.astro diff --git a/default.nix b/default.nix index c0868e1..4772e1c 100644 --- a/default.nix +++ b/default.nix @@ -76,9 +76,10 @@ in { chmod +rw -R node_modules ''; + PRODUCTION = true; + SECRET_MODULES_PATH = if quickshell-types == null then "" else quickshell-types; + buildPhase = '' - ${if quickshell-types != null then "export SECRET_MODULES_PATH=${quickshell-types}" else ""} - echo SECRET_MODULES_PATH: $SECRET_MODULES_PATH HOME=$(pwd)/garbage-tooling yarn build ''; diff --git a/src/components/Analytics.astro b/src/components/Analytics.astro new file mode 100644 index 0000000..3fae09e --- /dev/null +++ b/src/components/Analytics.astro @@ -0,0 +1,4 @@ +--- +const production = import.meta.env.PRODUCTION; +--- +{production && } diff --git a/src/config/Head.astro b/src/config/Head.astro index 8a05b81..840bb93 100644 --- a/src/config/Head.astro +++ b/src/config/Head.astro @@ -2,6 +2,7 @@ import "@styles/global.css"; import "@fontsource-variable/rubik"; import "@fontsource-variable/rubik/wght-italic.css"; +import Analytics from "@components/Analytics.astro"; interface Props { title: string; @@ -36,3 +37,5 @@ const { title, description } = Astro.props; + +