Skip to content

Commit f778d42

Browse files
authored
Merge pull request #856 from nervosnetwork/develop
Merge v2.47.0 into master
2 parents 88608c4 + c582d5d commit f778d42

4 files changed

Lines changed: 48 additions & 12 deletions

File tree

website/docusaurus.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ const config = {
1919
organizationName: "nervosnetwork",
2020
projectName: "docs-new",
2121
headTags: [
22+
...(enableGtag
23+
? [
24+
{
25+
tagName: "script",
26+
attributes: {
27+
defer: "true",
28+
src: "https://umami.retric.uk/script.js",
29+
"data-website-id": "f5709da4-2855-4563-9d49-b0cbbf1fb615",
30+
"data-domains": "docs.nervos.org",
31+
},
32+
},
33+
]
34+
: []),
2235
{
2336
tagName: "meta",
2437
attributes: {
@@ -172,6 +185,26 @@ const config = {
172185
from: "/docs/basics/concepts/economics",
173186
to: "/docs/assets-token-standards/economics",
174187
},
188+
{
189+
from: "/docs/basics/concepts/cell-model",
190+
to: "/docs/ckb-fundamentals/cell-model",
191+
},
192+
{
193+
from: "/docs/basics/concepts/ckb-vm",
194+
to: "/docs/ckb-fundamentals/ckb-vm",
195+
},
196+
{
197+
from: "/docs/basics/concepts/consensus",
198+
to: "/docs/ckb-fundamentals/consensus",
199+
},
200+
{
201+
from: "/docs/basics/concepts/cryptowallet",
202+
to: "/docs/integrate-wallets/intro-to-wallets",
203+
},
204+
{
205+
from: "/docs/basics/concepts/nervos-blockchain",
206+
to: "/docs/ckb-fundamentals/nervos-blockchain",
207+
},
175208
{
176209
from: "/docs/basics/glossary/",
177210
to: "/docs/tech-explanation/glossary",

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docs.nervos.org",
3-
"version": "2.46.0",
3+
"version": "2.47.0",
44
"description": "Official docs website for Nervos CKB",
55
"license": "MIT",
66
"scripts": {

website/src/components/AnalyticsTracking/utils.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,21 @@ export function sendAnalyticsEvent(
112112
eventName: string,
113113
params: AnalyticsEventParams
114114
): void {
115-
if (
116-
typeof window === "undefined" ||
117-
typeof window.gtag !== "function" ||
118-
isLocalAnalyticsHost()
119-
) {
115+
if (typeof window === "undefined" || isLocalAnalyticsHost()) {
120116
return;
121117
}
122118

123-
window.gtag(
124-
"event",
125-
eventName,
126-
Object.fromEntries(
127-
Object.entries(params).filter(([, value]) => value !== undefined)
128-
)
119+
const eventParams = Object.fromEntries(
120+
Object.entries(params).filter(([, value]) => value !== undefined)
129121
);
122+
123+
if (typeof window.gtag === "function") {
124+
window.gtag("event", eventName, eventParams);
125+
}
126+
127+
if (typeof window.umami?.track === "function") {
128+
window.umami.track(eventName, eventParams);
129+
}
130130
}
131131

132132
export function getLlmsFileName(value: string): string | undefined {

website/src/global.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
declare interface Window {
22
gtag?: (...args: any[]) => void;
3+
umami?: {
4+
track: (eventName: string, data?: Record<string, unknown>) => void;
5+
};
36
}

0 commit comments

Comments
 (0)