From 7cdc198e057e40105e94a643af002d6feef5809b Mon Sep 17 00:00:00 2001 From: AJ Webb Date: Tue, 28 Nov 2023 09:09:11 -1000 Subject: [PATCH] add analytics --- docusaurus.config.js | 48 +++++++++++++++++++++++++++++++------------- package.json | 1 + yarn.lock | 15 ++++++++++++++ 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 9b7171cc2..e0b40e6f1 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -59,20 +59,6 @@ const config = { }, ], - plugins: [ - async function myPlugin(context, options) { - return { - name: 'docusaurus-tailwindcss', - configurePostCss(postcssOptions) { - // Appends TailwindCSS and AutoPrefixer. - postcssOptions.plugins.push(require('tailwindcss')); - postcssOptions.plugins.push(require('autoprefixer')); - return postcssOptions; - }, - }; - }, - ], - themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ @@ -284,6 +270,40 @@ const config = { additionalLanguages: ['bash', 'json', 'kotlin', 'protobuf'], }, }), + + plugins: [ + async function myPlugin(context, options) { + return { + name: 'docusaurus-tailwindcss', + configurePostCss(postcssOptions) { + // Appends TailwindCSS and AutoPrefixer. + postcssOptions.plugins.push(require('tailwindcss')); + postcssOptions.plugins.push(require('autoprefixer')); + return postcssOptions; + }, + }; + }, + [ + '@docusaurus/plugin-google-analytics', + { + trackingID: 'G-J8X4N657D9', + anonymizeIP: true, + }, + ], + [ + '@docusaurus/plugin-client-redirects', + { + fromExtensions: ['html'], + toExtensions: ['html'], + redirects: [ + { + from: ['/main', '/master', '/v0.43', '/v0.44'], + to: '/', + }, + ], + }, + ], + ], }; module.exports = config; diff --git a/package.json b/package.json index 06b19ec9c..151b99edd 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ }, "devDependencies": { "@docusaurus/module-type-aliases": "^3.0.0", + "@docusaurus/plugin-client-redirects": "^3.0.0", "@docusaurus/tsconfig": "3.0.0", "@types/react": "^18.2.29", "autoprefixer": "^10.4.16", diff --git a/yarn.lock b/yarn.lock index c4bb8337e..03c6321f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2256,6 +2256,21 @@ react-helmet-async "*" react-loadable "npm:@docusaurus/react-loadable@5.5.2" +"@docusaurus/plugin-client-redirects@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.0.0.tgz#983880c467228ed8b1aba5f20ce564696e25f363" + integrity sha512-JcZLod4lgPdbv/OpCbNwTc57u54d01dcWiDy/sBaxls/4HkDGdj6838oBPzbBdnCWrmasBIRz3JYLk+1GU0IOQ== + dependencies: + "@docusaurus/core" "3.0.0" + "@docusaurus/logger" "3.0.0" + "@docusaurus/utils" "3.0.0" + "@docusaurus/utils-common" "3.0.0" + "@docusaurus/utils-validation" "3.0.0" + eta "^2.2.0" + fs-extra "^11.1.1" + lodash "^4.17.21" + tslib "^2.6.0" + "@docusaurus/plugin-content-blog@3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.0.0.tgz#5f3ede003b2b7103043918fbe3f436c116839ca8"