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

delei pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fesod.git


The following commit(s) were added to refs/heads/main by this push:
     new 90f507a2 feat: remove docusaurus-plugin-matomo and add custom Matomo 
tracking script (#632)
90f507a2 is described below

commit 90f507a222e880c971cbafec833aa201402eb6f7
Author: ian zhang <[email protected]>
AuthorDate: Mon Oct 6 20:24:36 2025 +0800

    feat: remove docusaurus-plugin-matomo and add custom Matomo tracking script 
(#632)
---
 website/docusaurus.config.js | 32 +++++++++++++++++++++++---------
 website/package.json         |  1 -
 2 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index 83c22bd1..e49ac778 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -86,8 +86,7 @@ const config = {
                 editUrl: `${repoUrl}/edit/${branch}/website/`,
                 editLocalizedFiles: true,
             },
-        ],
-        'docusaurus-plugin-matomo'
+        ]
     ],
     themeConfig: ({
         image: 'img/logo.svg',
@@ -198,16 +197,31 @@ const config = {
             theme: prismThemes.github,
             darkTheme: prismThemes.oneDark,
             additionalLanguages: ['java', 'bash']
-        },
-        matomo: {
-            matomoUrl: 'https://analytics.apache.org/',
-            siteId: '83',
-            phpLoader: 'matomo.php',
-            jsLoader: 'matomo.js',
         }
     }),
     themes: ['@docusaurus/theme-mermaid'],
-    headTags: [],
+    headTags: [
+        {
+            tagName: 'script',
+            attributes: {
+                type: 'text/javascript',
+            },
+            innerHTML: `
+              var _paq = window._paq = window._paq || [];
+               /* tracker methods like "setCustomDimension" should be called 
before "trackPageView" */
+              _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', '83']);
+                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);
+              })();
+            `,
+        },
+    ],
     markdown: {
         format: 'md',
         mermaid: true,
diff --git a/website/package.json b/website/package.json
index feddbd1e..f35f29ba 100644
--- a/website/package.json
+++ b/website/package.json
@@ -23,7 +23,6 @@
     "@docusaurus/theme-mermaid": "^3.9.1",
     "@mdx-js/react": "^3.0.0",
     "clsx": "^2.0.0",
-    "docusaurus-plugin-matomo": "^0.0.8",
     "markdownlint-cli2": "^0.18.1",
     "prism-react-renderer": "^2.3.0",
     "react": "^19.0.0",


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to