From 4b33dd7ce2626a9ce4d7fdbab34333513f0a4733 Mon Sep 17 00:00:00 2001 From: jimin Date: Tue, 31 Oct 2023 10:49:23 +0800 Subject: [PATCH] optimize: add docusaurus-plugin-includes (#395) --- docusaurus.config.js | 51 +++++++++++++++++++++++-------- package-lock.json | 72 ++++++++++++++++++++++++++++++++++++++++++-- package.json | 1 + 3 files changed, 110 insertions(+), 14 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 9ec71e62a28..1a964a0b18c 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -44,15 +44,7 @@ const config = { scripts: [ { src: '//g.alicdn.com/mamba/assets/0.0.19/mse-arc-ui.min.js' }, { - src: '//g.alicdn.com/alilog/mlog/aplus_v2.js', - id: 'beacon-aplus', - exparams: 'clog=o&aplus&sidx=aplusSidx&ckx=aplusCkx', - }, - { - src: '//g.alicdn.com/aes/??tracker/1.0.34/index.js,tracker-plugin-pv/2.4.5/index.js,tracker-plugin-event/1.2.5/index.js,tracker-plugin-jserror/1.0.13/index.js,tracker-plugin-api/1.1.14/index.js,tracker-plugin-perf/1.1.8/index.js,tracker-plugin-eventTiming/1.0.4/index.js', - }, - { - src: 'https://www.googletagmanager.com/gtag/js?id=G-YHS75WKFBR', + src: 'https://www.googletagmanager.com/gtag/js?id=G-0YDFJ7LX7F', async: true, }, ], @@ -61,9 +53,44 @@ const config = { href: '//g.alicdn.com/mamba/assets/0.0.19/mse-arc-ui.min.css', }, ], - plugins: [ - 'docusaurus-plugin-sass', - + plugins: ['docusaurus-plugin-sass', + ['docusaurus-plugin-includes', + { + injectedHtmlTags: { + headTags: [ + { + tagName: 'meta', + attributes: { + name: 'aes-config', + content: 'pid=xux-opensource&user_type=101&uid=&username=&dim10=nacos', + }, + }, + ], + preBodyTags: [ + { + tagName: 'script', + attributes: { + src: '//g.alicdn.com/alilog/mlog/aplus_v2.js', + id: 'beacon-aplus', + exparams: 'clog=o&aplus&sidx=aplusSidx&ckx=aplusCkx', + }, + }, + { + tagName: 'script', + attributes: { + src: '//g.alicdn.com/aes/??tracker/1.0.34/index.js,tracker-plugin-pv/2.4.5/index.js,tracker-plugin-event/1.2.5/index.js,tracker-plugin-jserror/1.0.13/index.js,tracker-plugin-api/1.1.14/index.js,tracker-plugin-perf/1.1.8/index.js,tracker-plugin-eventTiming/1.0.4/index.js', + }, + }, + { + tagName: 'script', + attributes: { + src: '//hm.baidu.com/hm.js?e3a5cec56ef8619cf9d7c2abebd509e3', + }, + } + ], + } + }, + ] ], presets: [ [ diff --git a/package-lock.json b/package-lock.json index 04c52c978fd..90ea404a392 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "Nacos", - "version": "0.0.0", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "Nacos", - "version": "0.0.0", + "version": "1.0.0", "dependencies": { "@docusaurus/core": "^2.4.3", "@docusaurus/preset-classic": "^2.4.3", @@ -15,6 +15,7 @@ "@types/react-dom": "^18.2.7", "classnames": "^2.3.2", "clsx": "^1.2.1", + "docusaurus-plugin-includes": "^1.1.4", "docusaurus-plugin-sass": "^0.2.5", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", @@ -6087,6 +6088,25 @@ "node": ">=6" } }, + "node_modules/docusaurus-plugin-includes": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-includes/-/docusaurus-plugin-includes-1.1.4.tgz", + "integrity": "sha512-4L7Eqker4xh1dyWZoz2Isz6JQTg8CWZvvSQyX2IHpEPjwovvD5DpEHHRlSk7gJLQNasWPP9DTHTd0fxFZ6jl2g==", + "dependencies": { + "@docusaurus/core": "^2.0.0-beta.5", + "@docusaurus/types": "^2.0.0-beta.5", + "@docusaurus/utils": "^2.0.0-beta.5", + "fs-extra": "^10.0.0", + "path": "^0.12.7" + }, + "engines": { + "node": ">=12.13.0" + }, + "peerDependencies": { + "react": "^16.8.4 || ^17.0.0", + "react-dom": "^16.8.4 || ^17.0.0" + } + }, "node_modules/docusaurus-plugin-sass": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/docusaurus-plugin-sass/-/docusaurus-plugin-sass-0.2.5.tgz", @@ -9153,6 +9173,15 @@ "tslib": "^2.0.3" } }, + "node_modules/path": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", + "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==", + "dependencies": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -9915,6 +9944,14 @@ "node": ">=6" } }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -10299,6 +10336,18 @@ "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" }, + "node_modules/react-loadable": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/react-loadable/-/react-loadable-5.5.0.tgz", + "integrity": "sha512-C8Aui0ZpMd4KokxRdVAm2bQtI03k2RMRNzOB+IipV3yxFTSVICv7WoUr5L9ALB5BmKO1iHgZtWM8EvYG83otdg==", + "peer": true, + "dependencies": { + "prop-types": "^15.5.0" + }, + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-loadable-ssr-addon-v5-slorber": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/react-loadable-ssr-addon-v5-slorber/-/react-loadable-ssr-addon-v5-slorber-1.0.1.tgz", @@ -11099,6 +11148,12 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/search-insights": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.9.0.tgz", + "integrity": "sha512-bkWW9nIHOFkLwjQ1xqVaMbjjO5vhP26ERsH9Y3pKr8imthofEFIxlnOabkmGcw6ksRj9jWidcI65vvjJH/nTGg==", + "peer": true + }, "node_modules/section-matter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", @@ -12585,11 +12640,24 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dependencies": { + "inherits": "2.0.3" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" + }, "node_modules/utila": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz", diff --git a/package.json b/package.json index 52e87067629..19016593bf4 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "@types/react-dom": "^18.2.7", "classnames": "^2.3.2", "clsx": "^1.2.1", + "docusaurus-plugin-includes": "^1.1.4", "docusaurus-plugin-sass": "^0.2.5", "prism-react-renderer": "^1.3.5", "react": "^17.0.2",