@docusaurus/preset-classic 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +5 -2
- package/lib/options.d.ts +2 -0
- package/package.json +15 -14
- package/src/index.ts +10 -1
- package/src/options.ts +2 -0
package/lib/index.js
CHANGED
|
@@ -17,7 +17,7 @@ function preset(context, opts = {}) {
|
|
|
17
17
|
const { themeConfig } = siteConfig;
|
|
18
18
|
const { algolia } = themeConfig;
|
|
19
19
|
const isProd = process.env.NODE_ENV === 'production';
|
|
20
|
-
const { debug, docs, blog, pages, sitemap, theme, googleAnalytics, gtag, ...rest } = opts;
|
|
20
|
+
const { debug, docs, blog, pages, sitemap, theme, googleAnalytics, gtag, googleTagManager, ...rest } = opts;
|
|
21
21
|
const themes = [];
|
|
22
22
|
themes.push(makePluginConfig('@docusaurus/theme-classic', theme));
|
|
23
23
|
if (algolia) {
|
|
@@ -48,11 +48,14 @@ function preset(context, opts = {}) {
|
|
|
48
48
|
if (gtag) {
|
|
49
49
|
plugins.push(makePluginConfig('@docusaurus/plugin-google-gtag', gtag));
|
|
50
50
|
}
|
|
51
|
+
if (googleTagManager) {
|
|
52
|
+
plugins.push(makePluginConfig('@docusaurus/plugin-google-tag-manager', googleTagManager));
|
|
53
|
+
}
|
|
51
54
|
if (isProd && sitemap !== false) {
|
|
52
55
|
plugins.push(makePluginConfig('@docusaurus/plugin-sitemap', sitemap));
|
|
53
56
|
}
|
|
54
57
|
if (Object.keys(rest).length > 0) {
|
|
55
|
-
throw new Error(`Unrecognized keys ${Object.keys(rest).join(', ')} found in preset-classic configuration. The allowed keys are debug, docs, blog, pages, sitemap, theme, googleAnalytics, gtag. Check the documentation: https://docusaurus.io/docs/using-plugins#docusauruspreset-classic for more information on how to configure individual plugins.`);
|
|
58
|
+
throw new Error(`Unrecognized keys ${Object.keys(rest).join(', ')} found in preset-classic configuration. The allowed keys are debug, docs, blog, pages, sitemap, theme, googleAnalytics, gtag, and googleTagManager. Check the documentation: https://docusaurus.io/docs/using-plugins#docusauruspreset-classic for more information on how to configure individual plugins.`);
|
|
56
59
|
}
|
|
57
60
|
return { themes, plugins };
|
|
58
61
|
}
|
package/lib/options.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { Options as PagesPluginOptions } from '@docusaurus/plugin-content-p
|
|
|
10
10
|
import type { Options as SitemapPluginOptions } from '@docusaurus/plugin-sitemap';
|
|
11
11
|
import type { Options as GAPluginOptions } from '@docusaurus/plugin-google-analytics';
|
|
12
12
|
import type { Options as GtagPluginOptions } from '@docusaurus/plugin-google-gtag';
|
|
13
|
+
import type { Options as GTMPluginOptions } from '@docusaurus/plugin-google-tag-manager';
|
|
13
14
|
import type { Options as ThemeOptions } from '@docusaurus/theme-classic';
|
|
14
15
|
import type { ThemeConfig as BaseThemeConfig } from '@docusaurus/types';
|
|
15
16
|
import type { UserThemeConfig as ClassicThemeConfig } from '@docusaurus/theme-common';
|
|
@@ -40,5 +41,6 @@ export declare type Options = {
|
|
|
40
41
|
* is present.
|
|
41
42
|
*/
|
|
42
43
|
gtag?: GtagPluginOptions;
|
|
44
|
+
googleTagManager?: GTMPluginOptions;
|
|
43
45
|
};
|
|
44
46
|
export declare type ThemeConfig = BaseThemeConfig & ClassicThemeConfig & AlgoliaThemeConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/preset-classic",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Classic preset for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -18,18 +18,19 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "2.
|
|
22
|
-
"@docusaurus/plugin-content-blog": "2.
|
|
23
|
-
"@docusaurus/plugin-content-docs": "2.
|
|
24
|
-
"@docusaurus/plugin-content-pages": "2.
|
|
25
|
-
"@docusaurus/plugin-debug": "2.
|
|
26
|
-
"@docusaurus/plugin-google-analytics": "2.
|
|
27
|
-
"@docusaurus/plugin-google-gtag": "2.
|
|
28
|
-
"@docusaurus/plugin-
|
|
29
|
-
"@docusaurus/
|
|
30
|
-
"@docusaurus/theme-
|
|
31
|
-
"@docusaurus/theme-
|
|
32
|
-
"@docusaurus/
|
|
21
|
+
"@docusaurus/core": "2.3.1",
|
|
22
|
+
"@docusaurus/plugin-content-blog": "2.3.1",
|
|
23
|
+
"@docusaurus/plugin-content-docs": "2.3.1",
|
|
24
|
+
"@docusaurus/plugin-content-pages": "2.3.1",
|
|
25
|
+
"@docusaurus/plugin-debug": "2.3.1",
|
|
26
|
+
"@docusaurus/plugin-google-analytics": "2.3.1",
|
|
27
|
+
"@docusaurus/plugin-google-gtag": "2.3.1",
|
|
28
|
+
"@docusaurus/plugin-google-tag-manager": "2.3.1",
|
|
29
|
+
"@docusaurus/plugin-sitemap": "2.3.1",
|
|
30
|
+
"@docusaurus/theme-classic": "2.3.1",
|
|
31
|
+
"@docusaurus/theme-common": "2.3.1",
|
|
32
|
+
"@docusaurus/theme-search-algolia": "2.3.1",
|
|
33
|
+
"@docusaurus/types": "2.3.1"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
35
36
|
"react": "^16.8.4 || ^17.0.0",
|
|
@@ -38,5 +39,5 @@
|
|
|
38
39
|
"engines": {
|
|
39
40
|
"node": ">=16.14"
|
|
40
41
|
},
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "cf12f21a10f6c5439ff931e61419c4bb03a5a2dc"
|
|
42
43
|
}
|
package/src/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export default function preset(
|
|
|
40
40
|
theme,
|
|
41
41
|
googleAnalytics,
|
|
42
42
|
gtag,
|
|
43
|
+
googleTagManager,
|
|
43
44
|
...rest
|
|
44
45
|
} = opts;
|
|
45
46
|
|
|
@@ -80,6 +81,14 @@ export default function preset(
|
|
|
80
81
|
if (gtag) {
|
|
81
82
|
plugins.push(makePluginConfig('@docusaurus/plugin-google-gtag', gtag));
|
|
82
83
|
}
|
|
84
|
+
if (googleTagManager) {
|
|
85
|
+
plugins.push(
|
|
86
|
+
makePluginConfig(
|
|
87
|
+
'@docusaurus/plugin-google-tag-manager',
|
|
88
|
+
googleTagManager,
|
|
89
|
+
),
|
|
90
|
+
);
|
|
91
|
+
}
|
|
83
92
|
if (isProd && sitemap !== false) {
|
|
84
93
|
plugins.push(makePluginConfig('@docusaurus/plugin-sitemap', sitemap));
|
|
85
94
|
}
|
|
@@ -87,7 +96,7 @@ export default function preset(
|
|
|
87
96
|
throw new Error(
|
|
88
97
|
`Unrecognized keys ${Object.keys(rest).join(
|
|
89
98
|
', ',
|
|
90
|
-
)} found in preset-classic configuration. The allowed keys are debug, docs, blog, pages, sitemap, theme, googleAnalytics, gtag. Check the documentation: https://docusaurus.io/docs/using-plugins#docusauruspreset-classic for more information on how to configure individual plugins.`,
|
|
99
|
+
)} found in preset-classic configuration. The allowed keys are debug, docs, blog, pages, sitemap, theme, googleAnalytics, gtag, and googleTagManager. Check the documentation: https://docusaurus.io/docs/using-plugins#docusauruspreset-classic for more information on how to configure individual plugins.`,
|
|
91
100
|
);
|
|
92
101
|
}
|
|
93
102
|
|
package/src/options.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type {Options as PagesPluginOptions} from '@docusaurus/plugin-content-pag
|
|
|
11
11
|
import type {Options as SitemapPluginOptions} from '@docusaurus/plugin-sitemap';
|
|
12
12
|
import type {Options as GAPluginOptions} from '@docusaurus/plugin-google-analytics';
|
|
13
13
|
import type {Options as GtagPluginOptions} from '@docusaurus/plugin-google-gtag';
|
|
14
|
+
import type {Options as GTMPluginOptions} from '@docusaurus/plugin-google-tag-manager';
|
|
14
15
|
import type {Options as ThemeOptions} from '@docusaurus/theme-classic';
|
|
15
16
|
import type {ThemeConfig as BaseThemeConfig} from '@docusaurus/types';
|
|
16
17
|
import type {UserThemeConfig as ClassicThemeConfig} from '@docusaurus/theme-common';
|
|
@@ -42,6 +43,7 @@ export type Options = {
|
|
|
42
43
|
* is present.
|
|
43
44
|
*/
|
|
44
45
|
gtag?: GtagPluginOptions;
|
|
46
|
+
googleTagManager?: GTMPluginOptions;
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
export type ThemeConfig = BaseThemeConfig &
|