@docusaurus/preset-classic 2.1.0 → 2.3.0

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 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,6 +48,9 @@ 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-gtag', googleTagManager));
53
+ }
51
54
  if (isProd && sitemap !== false) {
52
55
  plugins.push(makePluginConfig('@docusaurus/plugin-sitemap', sitemap));
53
56
  }
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.1.0",
3
+ "version": "2.3.0",
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.1.0",
22
- "@docusaurus/plugin-content-blog": "2.1.0",
23
- "@docusaurus/plugin-content-docs": "2.1.0",
24
- "@docusaurus/plugin-content-pages": "2.1.0",
25
- "@docusaurus/plugin-debug": "2.1.0",
26
- "@docusaurus/plugin-google-analytics": "2.1.0",
27
- "@docusaurus/plugin-google-gtag": "2.1.0",
28
- "@docusaurus/plugin-sitemap": "2.1.0",
29
- "@docusaurus/theme-classic": "2.1.0",
30
- "@docusaurus/theme-common": "2.1.0",
31
- "@docusaurus/theme-search-algolia": "2.1.0",
32
- "@docusaurus/types": "2.1.0"
21
+ "@docusaurus/core": "2.3.0",
22
+ "@docusaurus/plugin-content-blog": "2.3.0",
23
+ "@docusaurus/plugin-content-docs": "2.3.0",
24
+ "@docusaurus/plugin-content-pages": "2.3.0",
25
+ "@docusaurus/plugin-debug": "2.3.0",
26
+ "@docusaurus/plugin-google-analytics": "2.3.0",
27
+ "@docusaurus/plugin-google-gtag": "2.3.0",
28
+ "@docusaurus/plugin-google-tag-manager": "2.3.0",
29
+ "@docusaurus/plugin-sitemap": "2.3.0",
30
+ "@docusaurus/theme-classic": "2.3.0",
31
+ "@docusaurus/theme-common": "2.3.0",
32
+ "@docusaurus/theme-search-algolia": "2.3.0",
33
+ "@docusaurus/types": "2.3.0"
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": "be9b0942641184213485eba7fd75ceb0b328d3f4"
42
+ "gitHead": "ad477781bdca6a11fa9c6daef5048bdcec0ee37e"
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,11 @@ 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('@docusaurus/plugin-google-gtag', googleTagManager),
87
+ );
88
+ }
83
89
  if (isProd && sitemap !== false) {
84
90
  plugins.push(makePluginConfig('@docusaurus/plugin-sitemap', sitemap));
85
91
  }
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 &