From 47120fe1903f4c58edeadd448b7a6c3495878b55 Mon Sep 17 00:00:00 2001 From: aeneasr Date: Thu, 27 Jan 2022 13:38:26 +0000 Subject: [PATCH] chore: update docusaurus template Signed-off-by: aeneasr --- docs/src/plugins/docusaurus-plugin-matamo/analytics.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/plugins/docusaurus-plugin-matamo/analytics.js b/docs/src/plugins/docusaurus-plugin-matamo/analytics.js index d14972448..e0dc03963 100644 --- a/docs/src/plugins/docusaurus-plugin-matamo/analytics.js +++ b/docs/src/plugins/docusaurus-plugin-matamo/analytics.js @@ -12,6 +12,7 @@ export default (function () { return null } + let lastLocation = window.location.pathname return { onRouteUpdate({ location }) { if (!window._paq) { @@ -22,6 +23,11 @@ export default (function () { ? location.pathname + location.search + location.hash : undefined + if (lastLocation === location.pathname) { + return + } + lastLocation = location.pathname + _paq.push(['setCustomUrl', pagePath]) _paq.push(['setDocumentTitle', document.domain + '/' + document.title]) _paq.push(['trackPageView'])