diff --git a/.github/workflows/astro.yml b/.github/workflows/astro.yml index e9cca1b..fe78779 100644 --- a/.github/workflows/astro.yml +++ b/.github/workflows/astro.yml @@ -27,13 +27,14 @@ concurrency: cancel-in-progress: false env: - VITE_PUBLIC_BASE_URL: "/developer-icons" BUILD_PATH: "docs" # default value when not using subfolders # BUILD_PATH: subfolder jobs: build: name: Build + env: + PUBLIC_GA_MEASUREMENT_ID: ${{ secrets.PUBLIC_GA_MEASUREMENT_ID }} runs-on: ubuntu-latest steps: - name: Checkout diff --git a/docs/.env b/docs/.env deleted file mode 100644 index 3b1b819..0000000 --- a/docs/.env +++ /dev/null @@ -1 +0,0 @@ -VITE_PUBLIC_BASE_URL=/developer-icons/docs \ No newline at end of file diff --git a/docs/.gitignore b/docs/.gitignore index 0816b6f..016b59e 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -14,6 +14,7 @@ yarn-error.log* pnpm-debug.log* # environment variables +.env .env.production # macOS-specific files diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index d17de2d..2c4b677 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -1,17 +1,18 @@ import { defineConfig } from "astro/config"; import react from "@astrojs/react"; - import tailwind from "@astrojs/tailwind"; +import partytown from "@astrojs/partytown"; // https://astro.build/config export default defineConfig({ site: "https://xandemon.github.io", base: "/developer-icons/docs", publicDir: "./assets", - integrations: [ - react(), - tailwind({ - applyBaseStyles: false, - }), - ], -}); + integrations: [react(), tailwind({ + applyBaseStyles: false, + }), partytown({ + config: { + forward: ['dataLayer.push'] + } + })], +}); \ No newline at end of file diff --git a/docs/package-lock.json b/docs/package-lock.json index d427293..4642b63 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -8,6 +8,7 @@ "version": "0.0.1", "dependencies": { "@astrojs/check": "^0.6.0", + "@astrojs/partytown": "^2.1.2", "@astrojs/react": "^3.3.4", "@astrojs/tailwind": "^5.1.0", "@fontsource-variable/noto-sans": "^5.0.5", @@ -144,6 +145,16 @@ "vfile": "^6.0.3" } }, + "node_modules/@astrojs/partytown": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@astrojs/partytown/-/partytown-2.1.2.tgz", + "integrity": "sha512-1a9T5lqxtnrw0qLPo1KwliUvaaUzPNPtWucD8VxdwT7zqcpODFk1RzGgAgqVo+YhutFrTu/qclbtnOfXBuskjw==", + "license": "MIT", + "dependencies": { + "@builder.io/partytown": "^0.10.2", + "mrmime": "^2.0.0" + } + }, "node_modules/@astrojs/prism": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.1.0.tgz", @@ -559,6 +570,18 @@ "node": ">=6.9.0" } }, + "node_modules/@builder.io/partytown": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@builder.io/partytown/-/partytown-0.10.2.tgz", + "integrity": "sha512-A9U+4PREWcS+CCYzKGIPovtGB/PBgnH/8oQyCE6Nr9drDJk6cMPpLQIEajpGPmG9tYF7N3FkRvhXm/AS9+0iKg==", + "license": "MIT", + "bin": { + "partytown": "bin/partytown.cjs" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@emmetio/abbreviation": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.3.3.tgz", diff --git a/docs/package.json b/docs/package.json index a2549c2..81dad69 100644 --- a/docs/package.json +++ b/docs/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@astrojs/check": "^0.6.0", + "@astrojs/partytown": "^2.1.2", "@astrojs/react": "^3.3.4", "@astrojs/tailwind": "^5.1.0", "@fontsource-variable/noto-sans": "^5.0.5", diff --git a/docs/src/components/HeroSection.astro b/docs/src/components/HeroSection.astro index f4bf9d0..79e372e 100644 --- a/docs/src/components/HeroSection.astro +++ b/docs/src/components/HeroSection.astro @@ -2,7 +2,7 @@ import { ArrowUpRight } from "lucide-react"; import { Badge } from "./ui/badge"; import { Button } from "./ui/button"; -import { publicBaseUrl } from "@/lib/utils"; +import { publicBaseUrl } from "@/config"; ---
diff --git a/docs/src/components/Navbar.astro b/docs/src/components/Navbar.astro index 3183478..865308c 100644 --- a/docs/src/components/Navbar.astro +++ b/docs/src/components/Navbar.astro @@ -1,7 +1,7 @@ --- import { GitHubDarkIcon, NPMIcon } from "developer-icons"; import Container from "./Container.astro"; -import { publicBaseUrl } from "@/lib/utils"; +import { publicBaseUrl } from "@/config"; ---