Skip to content

Commit e484258

Browse files
authored
Merge pull request #158 from sakupi01/feat/misc
2 parents 0a680c0 + c205b6f commit e484258

File tree

8 files changed

+83
-8
lines changed

8 files changed

+83
-8
lines changed

apps/blog.sakupi01.com/astro.config.mjs

+12-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,21 @@ import { customClassName } from "./src/remark/customClassName";
2020
import { handleHTML } from "./src/remark/remark-embedder/handleHTML";
2121
import { CodeSandboxTransformer } from "./src/remark/remark-embedder/transformer";
2222

23+
import partytown from "@astrojs/partytown";
24+
2325
const cache = remarkEmbedderCache(".cache/remark-embedder.json");
2426

2527
export default defineConfig({
2628
site: "https://blog.sakupi01.com/",
27-
integrations: [mdx(), cacheSave(cache)],
29+
integrations: [
30+
mdx(),
31+
cacheSave(cache),
32+
partytown({
33+
config: {
34+
forward: ["dataLayer.push"],
35+
},
36+
}),
37+
],
2838
markdown: {
2939
shikiConfig: {
3040
themes: {
@@ -79,4 +89,4 @@ export default defineConfig({
7989
[rehypeAutolinkHeadings, { behavior: "wrap" }],
8090
],
8191
},
82-
});
92+
});

apps/blog.sakupi01.com/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
},
1818
"dependencies": {
1919
"@astrojs/mdx": "^4.1.0",
20+
"@astrojs/partytown": "^2.1.4",
2021
"@astrojs/rss": "^4.0.11",
2122
"@remark-embedder/core": "^3.0.3",
2223
"@remark-embedder/transformer-oembed": "^5.0.0",
@@ -35,8 +36,8 @@
3536
"remark-gfm": "4.0.0",
3637
"remark-link-card": "1.3.1",
3738
"remark-toc": "9.0.0",
39+
"sharp": "catalog:",
3840
"unist-util-visit": "^5.0.0",
39-
"zod": "catalog:",
40-
"sharp": "catalog:"
41+
"zod": "catalog:"
4142
}
4243
}

apps/blog.sakupi01.com/src/components/BlogPostCard.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { url, title, date, excerpt } = Astro.props;
55
---
66

77
<li class="blog-post-card">
8-
<a href={url}>
8+
<a href={url} target="_blank" >
99
<p class="published"><em><b>Published on {formatRFC2822Date(date)}</b></em></p>
1010
<h3 class="title">{title}</h3>
1111
</a>

apps/blog.sakupi01.com/src/layouts/BaseLayout.astro

+13
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ const { pageTitle = "saku's blog", description, url } = Astro.props;
3535
// @ts-ignore
3636
CSS.paintWorklet.addModule("/_scripts/curved-underline.js");
3737
})();
38+
</script>
39+
<script
40+
is:inline
41+
type="text/partytown"
42+
async
43+
src="https://www.googletagmanager.com/gtag/js?id=G-KC1QTQK44J"></script>
44+
<script is:inline type="text/partytown">
45+
window.dataLayer = window.dataLayer || [];
46+
function gtag() {
47+
dataLayer.push(arguments);
48+
}
49+
gtag("js", new Date());
50+
gtag("config", "G-KC1QTQK44J");
3851
</script>
3952
<meta name="generator" content={Astro.generator} />
4053
<title>{pageTitle}</title>

apps/sakupi01.com/astro.config.mjs

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
// @ts-check
2-
import { defineConfig } from 'astro/config';
2+
import { defineConfig } from "astro/config";
3+
import partytown from "@astrojs/partytown";
34

4-
// https://astro.build/config
5-
export default defineConfig({});
5+
export default defineConfig({
6+
integrations: [
7+
partytown({
8+
config: {
9+
forward: ["dataLayer.push"],
10+
},
11+
}),
12+
],
13+
});

apps/sakupi01.com/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"astro": "astro"
1010
},
1111
"dependencies": {
12+
"@astrojs/partytown": "^2.1.4",
1213
"@repo/ui": "workspace:*",
1314
"astro": "^5.2.5",
1415
"jsdom": "^26.0.0",

apps/sakupi01.com/src/layouts/Layout.astro

+13
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ const { pageTitle = "saku's blog", description, url } = Astro.props;
9393
}
9494
});
9595
</script>
96+
<script
97+
is:inline
98+
type="text/partytown"
99+
async
100+
src="https://www.googletagmanager.com/gtag/js?id=G-KC1QTQK44J"></script>
101+
<script is:inline type="text/partytown">
102+
window.dataLayer = window.dataLayer || [];
103+
function gtag() {
104+
dataLayer.push(arguments);
105+
}
106+
gtag("js", new Date());
107+
gtag("config", "G-KC1QTQK44J");
108+
</script>
96109
<meta name="generator" content={Astro.generator} />
97110
<title>{pageTitle}</title>
98111
</head>

pnpm-lock.yaml

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)