Skip to content

Commit 2857114

Browse files
committed
Merge pull request #15 from xandemon/analytics
Integrate basic analytics with GA4
2 parents eedd2f3 + 0cc39b0 commit 2857114

File tree

15 files changed

+87
-19
lines changed

15 files changed

+87
-19
lines changed

.github/workflows/astro.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ concurrency:
2727
cancel-in-progress: false
2828

2929
env:
30-
VITE_PUBLIC_BASE_URL: "/developer-icons"
3130
BUILD_PATH: "docs" # default value when not using subfolders
3231
# BUILD_PATH: subfolder
3332

3433
jobs:
3534
build:
3635
name: Build
36+
env:
37+
PUBLIC_GA_MEASUREMENT_ID: ${{ secrets.PUBLIC_GA_MEASUREMENT_ID }}
3738
runs-on: ubuntu-latest
3839
steps:
3940
- name: Checkout

docs/.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ yarn-error.log*
1414
pnpm-debug.log*
1515

1616
# environment variables
17+
.env
1718
.env.production
1819

1920
# macOS-specific files

docs/astro.config.mjs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import { defineConfig } from "astro/config";
22
import react from "@astrojs/react";
3-
43
import tailwind from "@astrojs/tailwind";
4+
import partytown from "@astrojs/partytown";
55

66
// https://astro.build/config
77
export default defineConfig({
88
site: "https://xandemon.github.io",
99
base: "/developer-icons/docs",
1010
publicDir: "./assets",
11-
integrations: [
12-
react(),
13-
tailwind({
14-
applyBaseStyles: false,
15-
}),
16-
],
17-
});
11+
integrations: [react(), tailwind({
12+
applyBaseStyles: false,
13+
}), partytown({
14+
config: {
15+
forward: ['dataLayer.push']
16+
}
17+
})],
18+
});

docs/package-lock.json

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@astrojs/check": "^0.6.0",
14+
"@astrojs/partytown": "^2.1.2",
1415
"@astrojs/react": "^3.3.4",
1516
"@astrojs/tailwind": "^5.1.0",
1617
"@fontsource-variable/noto-sans": "^5.0.5",

docs/src/components/HeroSection.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { ArrowUpRight } from "lucide-react";
33
import { Badge } from "./ui/badge";
44
import { Button } from "./ui/button";
5-
import { publicBaseUrl } from "@/lib/utils";
5+
import { publicBaseUrl } from "@/config";
66
---
77

88
<div class="flex items-center justify-between gap-4 w-full py-4">

docs/src/components/Navbar.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import { GitHubDarkIcon, NPMIcon } from "developer-icons";
33
import Container from "./Container.astro";
4-
import { publicBaseUrl } from "@/lib/utils";
4+
import { publicBaseUrl } from "@/config";
55
---
66

77
<div class="navbar bg-zinc-900">

docs/src/components/UnderDevelopment.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
import { Button } from "./ui/button";
3-
import { publicBaseUrl } from "@/lib/utils";
3+
import { publicBaseUrl } from "@/config";
44
---
55

66
<div class="w-full flex flex-col items-center justify-center gap-6">

docs/src/components/ui/iconCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import type { IconDataType } from "../../../../lib/iconsData";
55
import { generateIconCompName } from "../../../../lib/utils";
66
import { Badge } from "./badge";
77
import { Loader } from "./loader";
8-
import { downloader, publicBaseUrl } from "@/lib/utils";
8+
import { downloader } from "@/lib/utils";
9+
import { publicBaseUrl } from "@/config";
910

1011
export const IconCard = ({ icon }: { icon: IconDataType }) => {
1112
const [downloadLoading, setDownloadLoading] = useState(false);

0 commit comments

Comments
 (0)