From 51971649288b9a4d7e8c7136f4c2c4f5e872ab18 Mon Sep 17 00:00:00 2001 From: xandemon Date: Wed, 6 Nov 2024 23:29:40 +0545 Subject: [PATCH 1/3] docs: :package: package: add astro partytown --- docs/astro.config.mjs | 17 +++++++++-------- docs/package-lock.json | 23 +++++++++++++++++++++++ docs/package.json | 1 + 3 files changed, 33 insertions(+), 8 deletions(-) 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", From 3767e67f69835b06c20c02ec65e1f0c76c29d1b6 Mon Sep 17 00:00:00 2001 From: xandemon Date: Wed, 6 Nov 2024 23:30:39 +0545 Subject: [PATCH 2/3] docs: :star: feat: integrate basic GA4 --- .github/workflows/astro.yml | 2 ++ docs/.env | 1 - docs/.gitignore | 1 + docs/src/layouts/DocsLayout.astro | 18 ++++++++++++++++++ docs/src/layouts/Layout.astro | 19 +++++++++++++++++++ docs/src/lib/utils.ts | 2 +- 6 files changed, 41 insertions(+), 2 deletions(-) delete mode 100644 docs/.env diff --git a/.github/workflows/astro.yml b/.github/workflows/astro.yml index e9cca1b..aab82b7 100644 --- a/.github/workflows/astro.yml +++ b/.github/workflows/astro.yml @@ -34,6 +34,8 @@ env: 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/src/layouts/DocsLayout.astro b/docs/src/layouts/DocsLayout.astro index 893f885..e48315c 100644 --- a/docs/src/layouts/DocsLayout.astro +++ b/docs/src/layouts/DocsLayout.astro @@ -42,6 +42,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..9ea24f2 100644 --- a/docs/src/layouts/Layout.astro +++ b/docs/src/layouts/Layout.astro @@ -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..1e50e05 100644 --- a/docs/src/lib/utils.ts +++ b/docs/src/lib/utils.ts @@ -1,7 +1,7 @@ import { type ClassValue, clsx } from "clsx"; import { twMerge } from "tailwind-merge"; -export const publicBaseUrl = import.meta.env.VITE_PUBLIC_BASE_URL; +export const publicBaseUrl = import.meta.env.PUBLIC_VITE_PUBLIC_BASE_URL; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); From 0cc39b05e71aeb2e6f9682eb977a788d8f132e61 Mon Sep 17 00:00:00 2001 From: xandemon Date: Thu, 7 Nov 2024 00:06:47 +0545 Subject: [PATCH 3/3] docs: :zap: improvement: add config for docs --- docs/src/components/HeroSection.astro | 2 +- docs/src/components/Navbar.astro | 2 +- docs/src/components/UnderDevelopment.astro | 2 +- docs/src/components/ui/iconCard.tsx | 3 ++- docs/src/config.ts | 1 + docs/src/layouts/DocsLayout.astro | 3 ++- docs/src/layouts/Layout.astro | 2 +- docs/src/lib/utils.ts | 2 -- docs/src/pages/icons/[category].astro | 3 ++- 9 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 docs/src/config.ts 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"; ---