You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by ca...@apache.org on 2022/08/10 02:04:14 UTC

[incubator-linkis-website] branch dev updated: Replace Google Analytics with Matomo (#477)

This is an automated email from the ASF dual-hosted git repository.

casion pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-linkis-website.git


The following commit(s) were added to refs/heads/dev by this push:
     new 752fa52244 Replace Google Analytics with Matomo (#477)
752fa52244 is described below

commit 752fa5224430368ab218c929453a16cb4a54eff4
Author: Casion <ca...@gmail.com>
AuthorDate: Wed Aug 10 10:04:10 2022 +0800

    Replace Google Analytics with Matomo (#477)
    
    * prepar for 1.2.0 version
    
    * Replace Google Analytics with Matomo
---
 docs/introduction.md                         |   2 +-
 docusaurus.config.js                         |   9 ++
 package-lock.json                            | 130 ++++++++-------------------
 package.json                                 |   1 +
 src/pages/home/index.js                      |  17 ----
 static/script/matomo.js                      |  36 ++++++++
 versioned_docs/version-1.0.2/introduction.md |   2 +-
 versioned_docs/version-1.0.3/introduction.md |   2 +-
 versioned_docs/version-1.1.3/introduction.md |   2 +-
 9 files changed, 87 insertions(+), 114 deletions(-)

diff --git a/docs/introduction.md b/docs/introduction.md
index 9f81ad9f6d..a43bf55be6 100644
--- a/docs/introduction.md
+++ b/docs/introduction.md
@@ -55,7 +55,7 @@ Please follow [Compile Guide](development/linkis-compile-and-package.md) to comp
 Please refer to [Deployment_Documents](deployment/quick-deploy.md) to do the deployment. 
 
 ## Examples and Guidance
-You can find examples and guidance for how to use and manage Linkis in [User_Manual](user-guide/overview.md), [engine-usage_Documents](engine-usage/overview.md) and [API_Documents](../docs/api/overview.md).
+You can find examples and guidance for how to use and manage Linkis in [User_Manual](user-guide/overview.md), [engine-usage_Documents](engine-usage/overview.md) and [API_Documents](api/overview.md).
 
 ## Documentation
 
diff --git a/docusaurus.config.js b/docusaurus.config.js
index 9ceda9ccef..08b8496fb9 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -281,8 +281,17 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
       theme: require('prism-react-renderer/themes/dracula'),
       darkTheme: darkCodeTheme,
     },
+    scripts: ['/script/matomo.js'],
   },
   plugins: [
+     [
+        'docusaurus-plugin-less',
+        {
+          lessOptions: {
+            javascriptEnabled: true,
+          },
+        },
+      ],
     'docusaurus-plugin-sass',
     [
       '@docusaurus/plugin-content-docs',
diff --git a/package-lock.json b/package-lock.json
index 8cc29b495d..df43dd3a2e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1953,13 +1953,9 @@
         },
         "fsevents": {
           "version": "1.2.13",
-          "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-1.2.13.tgz",
+          "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
           "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
-          "optional": true,
-          "requires": {
-            "bindings": "^1.5.0",
-            "nan": "^2.12.1"
-          }
+          "optional": true
         },
         "glob-parent": {
           "version": "3.1.0",
@@ -3082,13 +3078,9 @@
         },
         "fsevents": {
           "version": "1.2.13",
-          "resolved": "http://10.107.103.115:8001/fsevents/download/fsevents-1.2.13.tgz",
-          "integrity": "sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg=",
-          "optional": true,
-          "requires": {
-            "bindings": "^1.5.0",
-            "nan": "^2.12.1"
-          }
+          "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
+          "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
+          "optional": true
         },
         "glob-parent": {
           "version": "3.1.0",
@@ -4260,13 +4252,9 @@
         },
         "fsevents": {
           "version": "1.2.13",
-          "resolved": "http://10.107.103.115:8001/fsevents/download/fsevents-1.2.13.tgz",
-          "integrity": "sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg=",
-          "optional": true,
-          "requires": {
-            "bindings": "^1.5.0",
-            "nan": "^2.12.1"
-          }
+          "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
+          "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
+          "optional": true
         },
         "glob-parent": {
           "version": "3.1.0",
@@ -5391,13 +5379,9 @@
         },
         "fsevents": {
           "version": "1.2.13",
-          "resolved": "http://10.107.103.115:8001/fsevents/download/fsevents-1.2.13.tgz",
-          "integrity": "sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg=",
-          "optional": true,
-          "requires": {
-            "bindings": "^1.5.0",
-            "nan": "^2.12.1"
-          }
+          "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
+          "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
+          "optional": true
         },
         "glob-parent": {
           "version": "3.1.0",
@@ -6482,13 +6466,9 @@
         },
         "fsevents": {
           "version": "1.2.13",
-          "resolved": "http://10.107.103.115:8001/fsevents/download/fsevents-1.2.13.tgz",
-          "integrity": "sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg=",
-          "optional": true,
-          "requires": {
-            "bindings": "^1.5.0",
-            "nan": "^2.12.1"
-          }
+          "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
+          "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
+          "optional": true
         },
         "glob-parent": {
           "version": "3.1.0",
@@ -7573,13 +7553,9 @@
         },
         "fsevents": {
           "version": "1.2.13",
-          "resolved": "http://10.107.103.115:8001/fsevents/download/fsevents-1.2.13.tgz",
-          "integrity": "sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg=",
-          "optional": true,
-          "requires": {
-            "bindings": "^1.5.0",
-            "nan": "^2.12.1"
-          }
+          "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
+          "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
+          "optional": true
         },
         "glob-parent": {
           "version": "3.1.0",
@@ -8671,13 +8647,9 @@
         },
         "fsevents": {
           "version": "1.2.13",
-          "resolved": "http://10.107.103.115:8001/fsevents/download/fsevents-1.2.13.tgz",
-          "integrity": "sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg=",
-          "optional": true,
-          "requires": {
-            "bindings": "^1.5.0",
-            "nan": "^2.12.1"
-          }
+          "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
+          "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
+          "optional": true
         },
         "glob-parent": {
           "version": "3.1.0",
@@ -9865,13 +9837,9 @@
         },
         "fsevents": {
           "version": "1.2.13",
-          "resolved": "http://10.107.103.115:8001/fsevents/download/fsevents-1.2.13.tgz",
-          "integrity": "sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg=",
-          "optional": true,
-          "requires": {
-            "bindings": "^1.5.0",
-            "nan": "^2.12.1"
-          }
+          "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
+          "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
+          "optional": true
         },
         "glob-parent": {
           "version": "3.1.0",
@@ -11074,13 +11042,9 @@
         },
         "fsevents": {
           "version": "1.2.13",
-          "resolved": "http://10.107.103.115:8001/fsevents/download/fsevents-1.2.13.tgz",
-          "integrity": "sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg=",
-          "optional": true,
-          "requires": {
-            "bindings": "^1.5.0",
-            "nan": "^2.12.1"
-          }
+          "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
+          "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
+          "optional": true
         },
         "glob-parent": {
           "version": "3.1.0",
@@ -12257,13 +12221,9 @@
         },
         "fsevents": {
           "version": "1.2.13",
-          "resolved": "http://10.107.103.115:8001/fsevents/download/fsevents-1.2.13.tgz",
-          "integrity": "sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg=",
-          "optional": true,
-          "requires": {
-            "bindings": "^1.5.0",
-            "nan": "^2.12.1"
-          }
+          "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
+          "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
+          "optional": true
         },
         "glob-parent": {
           "version": "3.1.0",
@@ -14444,15 +14404,6 @@
       "resolved": "http://10.107.103.115:8001/binary-extensions/download/binary-extensions-2.2.0.tgz",
       "integrity": "sha1-dfUC7q+f/eQvyYgpZFvk6na9ni0="
     },
-    "bindings": {
-      "version": "1.5.0",
-      "resolved": "http://10.107.103.115:8001/bindings/download/bindings-1.5.0.tgz",
-      "integrity": "sha1-EDU8npRTNLwFEabZCzj7x8nFBN8=",
-      "optional": true,
-      "requires": {
-        "file-uri-to-path": "1.0.0"
-      }
-    },
     "bluebird": {
       "version": "3.7.2",
       "resolved": "http://10.107.103.115:8001/bluebird/download/bluebird-3.7.2.tgz",
@@ -15664,6 +15615,11 @@
         "buffer-indexof": "^1.0.0"
       }
     },
+    "docusaurus-plugin-less": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/docusaurus-plugin-less/-/docusaurus-plugin-less-2.0.2.tgz",
+      "integrity": "sha512-ez6WSSvGS8HoJslYHeG5SflyShWvHFXeTTHXPBd3H1T3zgq9wp6wD7scXm+rXyyfhFhP5VNiIqhYB78z4OLjwg=="
+    },
     "docusaurus-plugin-sass": {
       "version": "0.2.2",
       "resolved": "https://registry.npmjs.org/docusaurus-plugin-sass/-/docusaurus-plugin-sass-0.2.2.tgz",
@@ -16254,12 +16210,6 @@
         "schema-utils": "^3.0.0"
       }
     },
-    "file-uri-to-path": {
-      "version": "1.0.0",
-      "resolved": "http://10.107.103.115:8001/file-uri-to-path/download/file-uri-to-path-1.0.0.tgz",
-      "integrity": "sha1-VTp7hEb/b2hDWcRF8eN6BdrMM90=",
-      "optional": true
-    },
     "filesize": {
       "version": "6.4.0",
       "resolved": "http://10.107.103.115:8001/filesize/download/filesize-6.4.0.tgz",
@@ -16488,8 +16438,8 @@
     },
     "fsevents": {
       "version": "2.3.2",
-      "resolved": "http://10.107.103.115:8001/fsevents/download/fsevents-2.3.2.tgz",
-      "integrity": "sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=",
+      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
+      "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
       "optional": true
     },
     "function-bind": {
@@ -18321,12 +18271,6 @@
       "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz",
       "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE="
     },
-    "nan": {
-      "version": "2.15.0",
-      "resolved": "http://10.107.103.115:8001/nan/download/nan-2.15.0.tgz",
-      "integrity": "sha1-PzSkc/8Y4VwbVia2KQO1rW5mX+4=",
-      "optional": true
-    },
     "nanoid": {
       "version": "3.1.30",
       "resolved": "http://10.107.103.115:8001/nanoid/download/nanoid-3.1.30.tgz",
@@ -19553,7 +19497,7 @@
     },
     "react-loadable": {
       "version": "npm:@docusaurus/react-loadable@5.5.2",
-      "resolved": "https://registry.npmmirror.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz",
+      "resolved": "https://registry.npmjs.org/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz",
       "integrity": "sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==",
       "requires": {
         "@types/react": "*",
diff --git a/package.json b/package.json
index 14170cd810..d863d9a89b 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
     "@docusaurus/plugin-content-docs": "^2.0.0-beta.6",
     "@docusaurus/preset-classic": "2.0.0-beta.6",
     "@docusaurus/theme-search-algolia": "^2.0.0-beta.6",
+    "docusaurus-plugin-less": "^2.0.2",
     "lodash-es": "^4.17.21",
     "prism-react-renderer": "^1.2.1",
     "react": "^17.0.1",
diff --git a/src/pages/home/index.js b/src/pages/home/index.js
index a9398acbcc..6b37aa3909 100644
--- a/src/pages/home/index.js
+++ b/src/pages/home/index.js
@@ -9,23 +9,6 @@ export default function() {
 
   const language = isBrowser && location.pathname.indexOf('/zh-CN/') === 0 ? 'zh-CN' : 'en';
   const dataSource = config?.[language];
-
-  let _paq = [];
-  isBrowser && (window._paq = []);
-  isBrowser && (_paq = window._paq);
-  _paq.push(['trackPageView']);
-  _paq.push(['enableLinkTracking']);
-  (function() {
-    var u="https://apachelinkis.matomo.cloud/";
-    _paq.push(['setTrackerUrl', u+'matomo.php']);
-    _paq.push(['setSiteId', '1']);
-    var d = isBrowser && document;
-    var g = isBrowser && d.createElement('script'), s = isBrowser && d.getElementsByTagName('script')[0];
-    isBrowser && (g.async=true); 
-    isBrowser && (g.src='//cdn.matomo.cloud/apachelinkis.matomo.cloud/matomo.js'); 
-    isBrowser && (s.parentNode.insertBefore(g,s));
-  })();
-
   return (
    <div>
      <div className="home-page slogan">
diff --git a/static/script/matomo.js b/static/script/matomo.js
new file mode 100644
index 0000000000..a24dee3539
--- /dev/null
+++ b/static/script/matomo.js
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+var _paq = (window._paq = window._paq || []);
+/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
+/* We explicitly disable cookie tracking to avoid privacy issues */
+_paq.push(['disableCookies']);
+_paq.push(['trackPageView']);
+_paq.push(['enableLinkTracking']);
+(function () {
+  var u = 'https://analytics.apache.org/';
+  _paq.push(['setTrackerUrl', u + 'matomo.php']);
+  _paq.push(['setSiteId', '22']);
+  var d = document,
+    g = d.createElement('script'),
+    s = d.getElementsByTagName('script')[0];
+  g.async = true;
+  g.src = u + 'matomo.js';
+  s.parentNode.insertBefore(g, s);
+})();
\ No newline at end of file
diff --git a/versioned_docs/version-1.0.2/introduction.md b/versioned_docs/version-1.0.2/introduction.md
index e93cf09f06..0df12d3dd1 100644
--- a/versioned_docs/version-1.0.2/introduction.md
+++ b/versioned_docs/version-1.0.2/introduction.md
@@ -58,7 +58,7 @@ Please follow [Compile Guide](development/linkis-compile-and-package.md) to comp
 Please refer to [Deployment_Documents](deployment/quick-deploy.md) to do the deployment. 
 
 # Examples and Guidance
-You can find examples and guidance for how to use and manage Linkis in [User_Manual](user-guide/overview.md), [engine-usage_Documents](engine-usage/overview.md) and [API_Documents](../version-1.0.2/api/overview.md).
+You can find examples and guidance for how to use and manage Linkis in [User_Manual](user-guide/overview.md), [engine-usage_Documents](engine-usage/overview.md) and [API_Documents](api/overview.md).
 
 # Documentation
 
diff --git a/versioned_docs/version-1.0.3/introduction.md b/versioned_docs/version-1.0.3/introduction.md
index e650604883..2eceb54bba 100644
--- a/versioned_docs/version-1.0.3/introduction.md
+++ b/versioned_docs/version-1.0.3/introduction.md
@@ -58,7 +58,7 @@ Please follow [Compile Guide](development/linkis-compile-and-package.md) to comp
 Please refer to [Deployment_Documents](deployment/quick-deploy.md) to do the deployment. 
 
 ## Examples and Guidance
-You can find examples and guidance for how to use and manage Linkis in [User_Manual](user-guide/overview.md), [engine-usage_Documents](engine-usage/overview.md) and [API_Documents](../../docs/api/overview.md).
+You can find examples and guidance for how to use and manage Linkis in [User_Manual](user-guide/overview.md), [engine-usage_Documents](engine-usage/overview.md) and [API_Documents](api/overview.md).
 
 ## Documentation
 
diff --git a/versioned_docs/version-1.1.3/introduction.md b/versioned_docs/version-1.1.3/introduction.md
index 9f81ad9f6d..a43bf55be6 100644
--- a/versioned_docs/version-1.1.3/introduction.md
+++ b/versioned_docs/version-1.1.3/introduction.md
@@ -55,7 +55,7 @@ Please follow [Compile Guide](development/linkis-compile-and-package.md) to comp
 Please refer to [Deployment_Documents](deployment/quick-deploy.md) to do the deployment. 
 
 ## Examples and Guidance
-You can find examples and guidance for how to use and manage Linkis in [User_Manual](user-guide/overview.md), [engine-usage_Documents](engine-usage/overview.md) and [API_Documents](../docs/api/overview.md).
+You can find examples and guidance for how to use and manage Linkis in [User_Manual](user-guide/overview.md), [engine-usage_Documents](engine-usage/overview.md) and [API_Documents](api/overview.md).
 
 ## Documentation
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org