Skip to content

Commit 29dbccc

Browse files
committed
Add shynet
1 parent 7a7422e commit 29dbccc

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

docusaurus.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ const config: Config = {
2323
locales: ['en'],
2424
},
2525

26+
scripts: [
27+
{
28+
src: "/scripts/shynet-inject.js",
29+
async: true,
30+
},
31+
],
32+
2633
presets: [
2734
[
2835
'classic',

static/scripts/shynet-inject.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(function () {
2+
if (typeof window === 'undefined') return;
3+
if (window.location.origin === 'http://localhost:3000') return;
4+
5+
var script = document.createElement("script");
6+
script.src = "https://shynet-mpb4.onrender.com/ingress/77ed9a77-a856-4d64-87a3-a1bc634cfcad/script.js";
7+
script.defer = true;
8+
document.body.appendChild(script);
9+
10+
var noscript = document.createElement("noscript");
11+
noscript.innerHTML =
12+
'<img src="https://shynet-mpb4.onrender.com/ingress/77ed9a77-a856-4d64-87a3-a1bc634cfcad/pixel.gif" alt="" referrerpolicy="no-referrer">';
13+
document.body.appendChild(noscript);
14+
})();

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// This file is not used in compilation. It is here just for a nice editor experience.
33
"extends": "@docusaurus/tsconfig",
44
"compilerOptions": {
5+
"jsx": "react",
56
"baseUrl": "."
67
},
78
"exclude": [".docusaurus", "build"]

0 commit comments

Comments
 (0)