mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-03 06:22:41 -08:00
fix(docs): point plausible tracker to /api/event
This commit is contained in:
@@ -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 -->
|
||||||
@@ -16,10 +16,11 @@ async function initPlausibleTracker() {
|
|||||||
const { init } = await import('@plausible-analytics/tracker');
|
const { init } = await import('@plausible-analytics/tracker');
|
||||||
init({
|
init({
|
||||||
domain: 'subminer.moe',
|
domain: 'subminer.moe',
|
||||||
endpoint: 'https://worker.subminer.moe',
|
endpoint: 'https://worker.subminer.moe/api/event',
|
||||||
outboundLinks: true,
|
outboundLinks: true,
|
||||||
fileDownloads: true,
|
fileDownloads: true,
|
||||||
formSubmissions: true,
|
formSubmissions: true,
|
||||||
|
captureOnLocalhost: false,
|
||||||
});
|
});
|
||||||
plausibleTrackerInitialized = true;
|
plausibleTrackerInitialized = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import { readFileSync } from 'node:fs';
|
|||||||
const docsThemePath = new URL('./.vitepress/theme/index.ts', import.meta.url);
|
const docsThemePath = new URL('./.vitepress/theme/index.ts', import.meta.url);
|
||||||
const docsThemeContents = readFileSync(docsThemePath, 'utf8');
|
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('@plausible-analytics/tracker');
|
||||||
expect(docsThemeContents).toContain('const { init } = await import');
|
expect(docsThemeContents).toContain('const { init } = await import');
|
||||||
expect(docsThemeContents).toContain("domain: 'subminer.moe'");
|
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('outboundLinks: true');
|
||||||
expect(docsThemeContents).toContain('fileDownloads: true');
|
expect(docsThemeContents).toContain('fileDownloads: true');
|
||||||
expect(docsThemeContents).toContain('formSubmissions: true');
|
expect(docsThemeContents).toContain('formSubmissions: true');
|
||||||
|
|||||||
Reference in New Issue
Block a user