Skip to content

Commit

Permalink
Remove partytown
Browse files Browse the repository at this point in the history
It doesn't work with the vercel adapter:

withastro/astro#12832
  • Loading branch information
venables committed Dec 31, 2024
1 parent 3ed1155 commit 3567d2f
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 19 deletions.
10 changes: 1 addition & 9 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-check
import partytown from "@astrojs/partytown"
import sitemap from "@astrojs/sitemap"
import tailwind from "@astrojs/tailwind"
import vercel from "@astrojs/vercel"
Expand All @@ -8,18 +7,11 @@ import { defineConfig } from "astro/config"
// https://astro.build/config
export default defineConfig({
site: "https://venabl.es",
output: "server",
adapter: vercel(),
integrations: [
tailwind({
applyBaseStyles: false
}),
sitemap(),
partytown({
config: {
forward: ["dataLayer.push"],
debug: true
}
})
sitemap()
]
})
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"typecheck": "tsc --noEmit --pretty"
},
"dependencies": {
"@astrojs/partytown": "^2.1.2",
"@astrojs/sitemap": "^3.2.1",
"@astrojs/tailwind": "^5.1.4",
"@astrojs/vercel": "^8.0.1",
Expand Down
1 change: 0 additions & 1 deletion src/content/posts/stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ For my personal site (this site), I've changed stacks several times over the yea
### Tech used:
- [Astro](https://astro.build) using Typescript, hosted on [Vercel](https://vercel.com). You can't beat Astro for content sites. It has it all built-in, and bundles everything into a tiny package.
- [Tailwind CSS](https://tailwindcss.com) for styling. Nothing compares.
- [Partytown](https://partytown.builder.io/) to offload analytics to a web worker.

The stack couldn't be simpler, thanks to Astro.

Expand Down
5 changes: 3 additions & 2 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ const { title, description, image, canonical } = Astro.props
<head>
<!-- Google tag (gtag.js) -->
<script
type="text/partytown"
async
is:inline
src="https://www.googletagmanager.com/gtag/js?id=G-MH0RX39N6C"></script>
<script type="text/partytown">
<script is:inline>
window.dataLayer = window.dataLayer || []
function gtag() {
dataLayer.push(arguments)
Expand Down
2 changes: 0 additions & 2 deletions src/pages/[id].astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ if (!entry) {
})
}
const { Content } = await render(entry)
export const prerender = true
---

<Layout title={entry.data.title} description={entry.data.description}>
Expand Down
2 changes: 2 additions & 0 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import DecryptingText from "../components/DecryptingText.astro"
import { fetchSupply, formatNumber } from "../lib/usdc-supply"
const supply = await fetchSupply()
export const prerender = false
---

<Layout title="Home">
Expand Down
2 changes: 0 additions & 2 deletions src/pages/projects.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import DecryptingText from "../components/DecryptingText.astro"
const entry = await getEntry("pages", "projects")
const { Content } = await render(entry)
export const prerender = true
---

<Layout title={entry.data.title} description={entry.data.description}>
Expand Down
2 changes: 0 additions & 2 deletions src/pages/writing.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const posts = allPosts.sort((a, b) => {
const dateB = new Date(b.data.date).getTime()
return dateB - dateA
})
export const prerender = true
---

<Layout title="Writing" description="Some things I think I think.">
Expand Down

0 comments on commit 3567d2f

Please sign in to comment.