fix(docs): point plausible tracker to /api/event

This commit is contained in:
2026-03-03 00:26:09 -08:00
parent f0bd0ba355
commit 6c80bd5843
3 changed files with 41 additions and 3 deletions

View File

@@ -0,0 +1,37 @@
---
id: TASK-84
title: 'Docs Plausible endpoint uses /api/event path'
status: Done
assignee: []
created_date: '2026-03-03 00:00'
updated_date: '2026-03-03 00:00'
labels: []
dependencies: []
priority: medium
ordinal: 12000
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Fix VitePress docs Plausible tracker config to post to hosted worker API event endpoint instead of worker root URL.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Docs theme Plausible `endpoint` points to `https://worker.subminer.moe/api/event`.
- [x] #2 Plausible docs test asserts `/api/event` endpoint path.
<!-- AC:END -->
## Final Summary
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Updated docs Plausible tracker endpoint to `https://worker.subminer.moe/api/event` and updated regression test expectation accordingly.
<!-- SECTION:FINAL_SUMMARY:END -->

View File

@@ -16,10 +16,11 @@ async function initPlausibleTracker() {
const { init } = await import('@plausible-analytics/tracker');
init({
domain: 'subminer.moe',
endpoint: 'https://worker.subminer.moe',
endpoint: 'https://worker.subminer.moe/api/event',
outboundLinks: true,
fileDownloads: true,
formSubmissions: true,
captureOnLocalhost: false,
});
plausibleTrackerInitialized = true;
}

View File

@@ -4,11 +4,11 @@ import { readFileSync } from 'node:fs';
const docsThemePath = new URL('./.vitepress/theme/index.ts', import.meta.url);
const docsThemeContents = readFileSync(docsThemePath, 'utf8');
test('docs theme configures plausible tracker for subminer.moe via worker.subminer.moe', () => {
test('docs theme configures plausible tracker for subminer.moe via worker.subminer.moe api endpoint', () => {
expect(docsThemeContents).toContain('@plausible-analytics/tracker');
expect(docsThemeContents).toContain('const { init } = await import');
expect(docsThemeContents).toContain("domain: 'subminer.moe'");
expect(docsThemeContents).toContain("endpoint: 'https://worker.subminer.moe'");
expect(docsThemeContents).toContain("endpoint: 'https://worker.subminer.moe/api/event'");
expect(docsThemeContents).toContain('outboundLinks: true');
expect(docsThemeContents).toContain('fileDownloads: true');
expect(docsThemeContents).toContain('formSubmissions: true');