diff --git a/astro.config.ts b/astro.config.ts
index fb364b5..d8b9563 100644
--- a/astro.config.ts
+++ b/astro.config.ts
@@ -5,11 +5,17 @@ import sitemap from '@astrojs/sitemap'
import tailwindcss from '@tailwindcss/vite'
import { defineConfig, fontProviders } from 'astro/config'
import expressiveCode from 'astro-expressive-code'
+import partytown from '@astrojs/partytown'
// https://astro.build/config
export default defineConfig({
site: 'https://nodejsdesignpatterns.com',
- integrations: [react(), expressiveCode(), sitemap()],
+ integrations: [
+ react(),
+ expressiveCode(),
+ sitemap(),
+ partytown({ config: { forward: ['dataLayer.push'] } }),
+ ],
vite: {
plugins: [tailwindcss()],
},
diff --git a/package.json b/package.json
index 7f2e904..77bd03c 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
+ "@astrojs/partytown": "^2.1.4",
"@astrojs/react": "^4.3.1",
"@astrojs/sitemap": "^3.6.0",
"@lucide/astro": "^0.522.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index da9475f..c588876 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -8,6 +8,9 @@ importers:
.:
dependencies:
+ '@astrojs/partytown':
+ specifier: ^2.1.4
+ version: 2.1.4
'@astrojs/react':
specifier: ^4.3.1
version: 4.3.1(@types/node@22.15.29)(@types/react-dom@19.1.5(@types/react@19.1.6))(@types/react@19.1.6)(jiti@2.4.2)(lightningcss@1.30.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
@@ -136,6 +139,9 @@ packages:
'@astrojs/markdown-remark@6.3.7':
resolution: {integrity: sha512-KXGdq6/BC18doBCYXp08alHlWChH0hdD2B1qv9wIyOHbvwI5K6I7FhSta8dq1hBQNdun8YkKPR013D/Hm8xd0g==}
+ '@astrojs/partytown@2.1.4':
+ resolution: {integrity: sha512-loUrAu0cGYFDC6dHVRiomdsBJ41VjDYXPA+B3Br51V5hENFgDSOLju86OIj1TvBACcsB22UQV7BlppODDG5gig==}
+
'@astrojs/prism@3.3.0':
resolution: {integrity: sha512-q8VwfU/fDZNoDOf+r7jUnMC2//H2l0TuQ6FkGJL8vD8nw/q5KiL3DS1KKBI3QhI9UQhpJ5dc7AtqfbXWuOgLCQ==}
engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0}
@@ -664,6 +670,11 @@ packages:
resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==}
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
+ '@qwik.dev/partytown@0.11.2':
+ resolution: {integrity: sha512-795y49CqBiKiwKAD+QBZlzlqEK275hVcazZ7wBPSfgC23L+vWuA7PJmMpgxojOucZHzYi5rAAQ+IP1I3BKVZxw==}
+ engines: {node: '>=18.0.0'}
+ hasBin: true
+
'@radix-ui/react-compose-refs@1.1.2':
resolution: {integrity: sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==}
peerDependencies:
@@ -1379,6 +1390,10 @@ packages:
dlv@1.1.3:
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
+ dotenv@16.6.1:
+ resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==}
+ engines: {node: '>=12'}
+
dset@3.1.4:
resolution: {integrity: sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA==}
engines: {node: '>=4'}
@@ -2812,6 +2827,11 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@astrojs/partytown@2.1.4':
+ dependencies:
+ '@qwik.dev/partytown': 0.11.2
+ mrmime: 2.0.1
+
'@astrojs/prism@3.3.0':
dependencies:
prismjs: 1.30.0
@@ -3299,6 +3319,10 @@ snapshots:
'@pkgr/core@0.2.9': {}
+ '@qwik.dev/partytown@0.11.2':
+ dependencies:
+ dotenv: 16.6.1
+
'@radix-ui/react-compose-refs@1.1.2(@types/react@19.1.6)(react@19.1.0)':
dependencies:
react: 19.1.0
@@ -4100,6 +4124,8 @@ snapshots:
dlv@1.1.3: {}
+ dotenv@16.6.1: {}
+
dset@3.1.4: {}
electron-to-chromium@1.5.161: {}
diff --git a/src/Layout.astro b/src/Layout.astro
index a5c9f1f..64f604e 100644
--- a/src/Layout.astro
+++ b/src/Layout.astro
@@ -140,6 +140,28 @@ const {
+
+
+
+