Skip to content

Commit 4afee1d

Browse files
authored
Merge pull request #4 from milan-codes/develop
Added Plausible Analytics
2 parents 5a0bc49 + 0cad49b commit 4afee1d

4 files changed

Lines changed: 37 additions & 1 deletion

File tree

astro.config.mjs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,20 @@ import svelte from "@astrojs/svelte";
66
// https://astro.build/config
77
import tailwind from "@astrojs/tailwind";
88

9+
// https://astro.build/config
10+
import partytown from "@astrojs/partytown";
11+
912
// https://astro.build/config
1013
export default defineConfig({
11-
integrations: [svelte(), tailwind()],
14+
integrations: [
15+
svelte(),
16+
tailwind(),
17+
partytown({
18+
config: {
19+
forward: ["dataLayer.push"],
20+
},
21+
}),
22+
],
1223
markdown: {
1324
remarkPlugins: ["remark-math"],
1425
rehypePlugins: ["rehype-katex"],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"astro": "astro"
1212
},
1313
"dependencies": {
14+
"@astrojs/partytown": "^1.2.3",
1415
"@astrojs/svelte": "^2.0.1",
1516
"@astrojs/tailwind": "^3.0.1",
1617
"astro": "^2.0.4",

src/layouts/BaseLayout.astro

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ const { title } = Astro.props;
1414
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
1515
<meta name="generator" content={Astro.generator} />
1616
<title>{title}</title>
17+
<script
18+
type="text/partytown"
19+
defer
20+
data-domain="milan-codes.github.io"
21+
src="https://plausible.io/js/script.js"
22+
></script>
1723
</head>
1824
<body class="max-w-lg mx-auto px-4 bg-gray-50 dark:bg-[#0a0a0a]">
1925
<slot />

yarn.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@
5757
unist-util-visit "^4.1.0"
5858
vfile "^5.3.2"
5959

60+
"@astrojs/partytown@^1.2.3":
61+
version "1.2.3"
62+
resolved "https://registry.yarnpkg.com/@astrojs/partytown/-/partytown-1.2.3.tgz#ba82b2179017634b53fdf50c3bc12340ace6ec21"
63+
integrity sha512-EYdeFfSEe5RTQsz+6Mxb9JLJWztZEOw0yjAxoDbntCdTkxDCnIwqRAhUwftx+zWsh+JIw1hOkLRNN8QOmwBiqA==
64+
dependencies:
65+
"@builder.io/partytown" "^0.7.4"
66+
mrmime "^1.0.0"
67+
6068
"@astrojs/prism@^2.0.0":
6169
version "2.0.0"
6270
resolved "https://registry.yarnpkg.com/@astrojs/prism/-/prism-2.0.0.tgz#e35c677b13c55b209e39db5d62424844b1b7c41b"
@@ -313,6 +321,11 @@
313321
"@babel/helper-validator-identifier" "^7.19.1"
314322
to-fast-properties "^2.0.0"
315323

324+
"@builder.io/partytown@^0.7.4":
325+
version "0.7.6"
326+
resolved "https://registry.yarnpkg.com/@builder.io/partytown/-/partytown-0.7.6.tgz#697acea6b552167a4dd43ddd4827018aa42e0364"
327+
integrity sha512-snXIGNiZpqjno3XYQN2lbBB+05hsQR/LSttbtIW1c0gmZ7Kh/DIo0YrxlDxCDulAMFPFM8J+4voLwvYepSj3sw==
328+
316329
"@emmetio/abbreviation@^2.2.3":
317330
version "2.2.3"
318331
resolved "https://registry.yarnpkg.com/@emmetio/abbreviation/-/abbreviation-2.2.3.tgz#2b3c0383c1a4652f677d5b56fb3f1616fe16ef10"
@@ -2532,6 +2545,11 @@ mri@^1.1.0:
25322545
resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b"
25332546
integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==
25342547

2548+
mrmime@^1.0.0:
2549+
version "1.0.1"
2550+
resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.1.tgz#5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27"
2551+
integrity sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==
2552+
25352553
ms@2.1.2:
25362554
version "2.1.2"
25372555
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"

0 commit comments

Comments
 (0)