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";
---
diff --git a/docs/src/components/UnderDevelopment.astro b/docs/src/components/UnderDevelopment.astro
index 70184d3..458726a 100644
--- a/docs/src/components/UnderDevelopment.astro
+++ b/docs/src/components/UnderDevelopment.astro
@@ -1,6 +1,6 @@
---
import { Button } from "./ui/button";
-import { publicBaseUrl } from "@/lib/utils";
+import { publicBaseUrl } from "@/config";
---
diff --git a/docs/src/components/ui/iconCard.tsx b/docs/src/components/ui/iconCard.tsx
index 32f3d40..ed5f793 100644
--- a/docs/src/components/ui/iconCard.tsx
+++ b/docs/src/components/ui/iconCard.tsx
@@ -5,7 +5,8 @@ import type { IconDataType } from "../../../../lib/iconsData";
import { generateIconCompName } from "../../../../lib/utils";
import { Badge } from "./badge";
import { Loader } from "./loader";
-import { downloader, publicBaseUrl } from "@/lib/utils";
+import { downloader } from "@/lib/utils";
+import { publicBaseUrl } from "@/config";
export const IconCard = ({ icon }: { icon: IconDataType }) => {
const [downloadLoading, setDownloadLoading] = useState(false);
diff --git a/docs/src/config.ts b/docs/src/config.ts
new file mode 100644
index 0000000..a37bbbc
--- /dev/null
+++ b/docs/src/config.ts
@@ -0,0 +1,5 @@
+const publicBaseUrl = import.meta.env.PROD
+ ? "/developer-icons"
+ : "/developer-icons/docs";
+
+export { publicBaseUrl };
diff --git a/docs/src/layouts/DocsLayout.astro b/docs/src/layouts/DocsLayout.astro
index 893f885..ba452c3 100644
--- a/docs/src/layouts/DocsLayout.astro
+++ b/docs/src/layouts/DocsLayout.astro
@@ -1,7 +1,8 @@
---
import Container from "@/components/Container.astro";
import Navbar from "@/components/Navbar.astro";
-import { cn, publicBaseUrl } from "@/lib/utils";
+import { cn } from "@/lib/utils";
+import { publicBaseUrl } from "@/config";
import "@fontsource-variable/noto-sans";
import "../styles/globals.css";
import "../styles/docs.css";
@@ -42,6 +43,24 @@ flattenedDocs.sort((a, b) => a.frontmatter.order - b.frontmatter.order);
{props.frontmatter.title}
+
+
+
+
diff --git a/docs/src/layouts/Layout.astro b/docs/src/layouts/Layout.astro
index f9ea49a..578dd61 100644
--- a/docs/src/layouts/Layout.astro
+++ b/docs/src/layouts/Layout.astro
@@ -1,7 +1,7 @@
---
import Container from "@/components/Container.astro";
import Navbar from "@/components/Navbar.astro";
-import { publicBaseUrl } from "@/lib/utils";
+import { publicBaseUrl } from "@/config";
import "@fontsource-variable/noto-sans";
import "../styles/globals.css";
@@ -28,6 +28,25 @@ const { title } = Astro.props;
/>
{title}
+
+
+
+
diff --git a/docs/src/lib/utils.ts b/docs/src/lib/utils.ts
index 025d9fb..64ea0b7 100644
--- a/docs/src/lib/utils.ts
+++ b/docs/src/lib/utils.ts
@@ -1,8 +1,6 @@
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
-export const publicBaseUrl = import.meta.env.VITE_PUBLIC_BASE_URL;
-
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
diff --git a/docs/src/pages/icons/[category].astro b/docs/src/pages/icons/[category].astro
index 861db64..ac55a34 100644
--- a/docs/src/pages/icons/[category].astro
+++ b/docs/src/pages/icons/[category].astro
@@ -3,7 +3,8 @@ import Layout from "@/layouts/Layout.astro";
import { IconsList } from "@/components/iconsList";
import { categoriesData, iconsData } from "../../../../lib/iconsData";
import type { Category as CategoryType } from "../../../../lib/iconsData";
-import { cn, publicBaseUrl } from "@/lib/utils";
+import { cn } from "@/lib/utils";
+import { publicBaseUrl } from "@/config";
export function getStaticPaths() {
return ["All", ...categoriesData].map((category) => ({