Skip to content

Commit 1086e5e

Browse files
committed
add outbound links & 404
1 parent badf185 commit 1086e5e

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>E621 OpenAPI Documentation</title>
6-
<script defer data-domain="e621.wiki" src="https://plausible.furry.computer/js/script.tagged-events.js"></script>
6+
<script defer data-domain="e621.wiki" src="https://plausible.furry.computer/js/script.tagged-events.outbound-links.js"></script>
7+
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
78
</head>
89

910
<body>

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"clean-webpack-plugin": "^4.0.0",
2323
"favicons-webpack-plugin": "^6.0.1",
2424
"html-webpack-plugin": "^5.6.0",
25-
"jquery": "^3.7.1",
2625
"swagger-themes": "^1.4.3",
2726
"swagger-ui": "^5.17.14"
2827
},

pnpm-lock.yaml

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

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import SwaggerUI from "swagger-ui";
22
import "swagger-ui/dist/swagger-ui.css";
33
import "swagger-themes/themes/dark.css";
4-
import "jquery";
4+
5+
declare function plausible(event: string, properties?: { props: Record<string, string>; }): void;
56

67
function addEvent(selector: string, event: string, properties: (element: Element) => Record<string, string>): void {
78
const items = Array.from(document.querySelectorAll(selector));
@@ -25,3 +26,7 @@ SwaggerUI({
2526
addEvent(".json-schema-2020-12-expand-deep-button", "Toggle Schema", element => ({ schema: element.parentNode!.querySelector(".json-schema-2020-12__title")!.textContent! }));
2627
}
2728
});
29+
30+
document.addEventListener("DOMContentLoaded", function () {
31+
plausible("404", { props: { path: document.location.pathname } });
32+
});

0 commit comments

Comments
 (0)