Skip to content

Commit b914423

Browse files
committed
Fix reporting
1 parent 683d8d8 commit b914423

File tree

8 files changed

+125
-154
lines changed

8 files changed

+125
-154
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,3 @@ pnpm-debug.log*
1919

2020
# macOS-specific files
2121
.DS_Store
22-
23-
# Local Netlify folder
24-
.netlify

_routes.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"version": 1,
3+
"include": ["/api/*"],
4+
"exclude": []
5+
}

functions/api/event.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export async function onRequest(context) {
2+
context.passThroughOnException();
3+
const forwardedRequest = new Request(context.request);
4+
forwardedRequest.headers.delete('cookie');
5+
6+
return await fetch("https://plausible.io/api/event", forwardedRequest);
7+
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"@astrojs/starlight": "0.31.1",
1414
"astro": "5.1.10",
1515
"astro-broken-link-checker": "github:firegiant/astro-broken-link-checker",
16-
"plausible-tracker": "0.3.9",
1716
"sharp": "0.33.5"
1817
}
1918
}

pnpm-lock.yaml

Lines changed: 108 additions & 141 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/starlight/Head.astro

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,4 @@ import Default from '@astrojs/starlight/components/Head.astro';
77
<slot />
88
</Default>
99

10-
<script>
11-
import Plausible from 'plausible-tracker';
12-
const { trackEvent, trackPageview } = Plausible();
13-
14-
window.plausible = window.plausible || trackEvent;
15-
trackPageview();
16-
</script>
10+
<script src="@js/script.js"></script>

src/js/script.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"extends": "astro/tsconfigs/strict",
3-
"exclude": ["dist"],
3+
"exclude": ["functions", "dist"],
44
"compilerOptions": {
55
"baseUrl": ".",
66
"paths": {
77
"@assets/*": ["src/assets/*"],
88
"@components/*": ["src/components/*"],
9-
"@examples/*": ["examples/*"]
9+
"@examples/*": ["examples/*"],
10+
"@js/*": ["src/js/*"]
1011
}
1112
}
1213
}

0 commit comments

Comments
 (0)