@docusaurus/preset-classic 2.0.0-beta.14 → 2.0.0-beta.15
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 +8 -2
- package/package.json +13 -12
- package/src/index.ts +12 -2
- package/src/preset-classic.d.ts +21 -11
package/lib/index.js
CHANGED
|
@@ -23,6 +23,12 @@ function preset(context, opts = {}) {
|
|
|
23
23
|
if (algolia) {
|
|
24
24
|
themes.push(require.resolve('@docusaurus/theme-search-algolia'));
|
|
25
25
|
}
|
|
26
|
+
if ('gtag' in themeConfig) {
|
|
27
|
+
throw new Error('The "gtag" field in themeConfig should now be specified as option for plugin-google-gtag. For preset-classic, simply move themeConfig.gtag to preset options. More information at https://github.com/facebook/docusaurus/pull/5832.');
|
|
28
|
+
}
|
|
29
|
+
if ('googleAnalytics' in themeConfig) {
|
|
30
|
+
throw new Error('The "googleAnalytics" field in themeConfig should now be specified as option for plugin-google-analytics. For preset-classic, simply move themeConfig.googleAnalytics to preset options. More information at https://github.com/facebook/docusaurus/pull/5832.');
|
|
31
|
+
}
|
|
26
32
|
const plugins = [];
|
|
27
33
|
if (docs !== false) {
|
|
28
34
|
plugins.push(makePluginConfig('@docusaurus/plugin-content-docs', docs));
|
|
@@ -33,13 +39,13 @@ function preset(context, opts = {}) {
|
|
|
33
39
|
if (pages !== false) {
|
|
34
40
|
plugins.push(makePluginConfig('@docusaurus/plugin-content-pages', pages));
|
|
35
41
|
}
|
|
36
|
-
if (
|
|
42
|
+
if (googleAnalytics) {
|
|
37
43
|
plugins.push(makePluginConfig('@docusaurus/plugin-google-analytics', googleAnalytics));
|
|
38
44
|
}
|
|
39
45
|
if (debug || (debug === undefined && !isProd)) {
|
|
40
46
|
plugins.push(require.resolve('@docusaurus/plugin-debug'));
|
|
41
47
|
}
|
|
42
|
-
if (
|
|
48
|
+
if (gtag) {
|
|
43
49
|
plugins.push(makePluginConfig('@docusaurus/plugin-google-gtag', gtag));
|
|
44
50
|
}
|
|
45
51
|
if (isProd && sitemap !== false) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/preset-classic",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.15",
|
|
4
4
|
"description": "Classic preset for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/preset-classic.d.ts",
|
|
@@ -18,16 +18,17 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "2.0.0-beta.
|
|
22
|
-
"@docusaurus/plugin-content-blog": "2.0.0-beta.
|
|
23
|
-
"@docusaurus/plugin-content-docs": "2.0.0-beta.
|
|
24
|
-
"@docusaurus/plugin-content-pages": "2.0.0-beta.
|
|
25
|
-
"@docusaurus/plugin-debug": "2.0.0-beta.
|
|
26
|
-
"@docusaurus/plugin-google-analytics": "2.0.0-beta.
|
|
27
|
-
"@docusaurus/plugin-google-gtag": "2.0.0-beta.
|
|
28
|
-
"@docusaurus/plugin-sitemap": "2.0.0-beta.
|
|
29
|
-
"@docusaurus/theme-classic": "2.0.0-beta.
|
|
30
|
-
"@docusaurus/theme-
|
|
21
|
+
"@docusaurus/core": "2.0.0-beta.15",
|
|
22
|
+
"@docusaurus/plugin-content-blog": "2.0.0-beta.15",
|
|
23
|
+
"@docusaurus/plugin-content-docs": "2.0.0-beta.15",
|
|
24
|
+
"@docusaurus/plugin-content-pages": "2.0.0-beta.15",
|
|
25
|
+
"@docusaurus/plugin-debug": "2.0.0-beta.15",
|
|
26
|
+
"@docusaurus/plugin-google-analytics": "2.0.0-beta.15",
|
|
27
|
+
"@docusaurus/plugin-google-gtag": "2.0.0-beta.15",
|
|
28
|
+
"@docusaurus/plugin-sitemap": "2.0.0-beta.15",
|
|
29
|
+
"@docusaurus/theme-classic": "2.0.0-beta.15",
|
|
30
|
+
"@docusaurus/theme-common": "2.0.0-beta.15",
|
|
31
|
+
"@docusaurus/theme-search-algolia": "2.0.0-beta.15"
|
|
31
32
|
},
|
|
32
33
|
"peerDependencies": {
|
|
33
34
|
"react": "^16.8.4 || ^17.0.0",
|
|
@@ -36,5 +37,5 @@
|
|
|
36
37
|
"engines": {
|
|
37
38
|
"node": ">=14"
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "6cfad16436c07d8d11e5c2e1486dc59afd483e33"
|
|
40
41
|
}
|
package/src/index.ts
CHANGED
|
@@ -48,6 +48,16 @@ export default function preset(
|
|
|
48
48
|
if (algolia) {
|
|
49
49
|
themes.push(require.resolve('@docusaurus/theme-search-algolia'));
|
|
50
50
|
}
|
|
51
|
+
if ('gtag' in themeConfig) {
|
|
52
|
+
throw new Error(
|
|
53
|
+
'The "gtag" field in themeConfig should now be specified as option for plugin-google-gtag. For preset-classic, simply move themeConfig.gtag to preset options. More information at https://github.com/facebook/docusaurus/pull/5832.',
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
if ('googleAnalytics' in themeConfig) {
|
|
57
|
+
throw new Error(
|
|
58
|
+
'The "googleAnalytics" field in themeConfig should now be specified as option for plugin-google-analytics. For preset-classic, simply move themeConfig.googleAnalytics to preset options. More information at https://github.com/facebook/docusaurus/pull/5832.',
|
|
59
|
+
);
|
|
60
|
+
}
|
|
51
61
|
|
|
52
62
|
const plugins: PluginConfig[] = [];
|
|
53
63
|
if (docs !== false) {
|
|
@@ -59,7 +69,7 @@ export default function preset(
|
|
|
59
69
|
if (pages !== false) {
|
|
60
70
|
plugins.push(makePluginConfig('@docusaurus/plugin-content-pages', pages));
|
|
61
71
|
}
|
|
62
|
-
if (
|
|
72
|
+
if (googleAnalytics) {
|
|
63
73
|
plugins.push(
|
|
64
74
|
makePluginConfig('@docusaurus/plugin-google-analytics', googleAnalytics),
|
|
65
75
|
);
|
|
@@ -67,7 +77,7 @@ export default function preset(
|
|
|
67
77
|
if (debug || (debug === undefined && !isProd)) {
|
|
68
78
|
plugins.push(require.resolve('@docusaurus/plugin-debug'));
|
|
69
79
|
}
|
|
70
|
-
if (
|
|
80
|
+
if (gtag) {
|
|
71
81
|
plugins.push(makePluginConfig('@docusaurus/plugin-google-gtag', gtag));
|
|
72
82
|
}
|
|
73
83
|
if (isProd && sitemap !== false) {
|
package/src/preset-classic.d.ts
CHANGED
|
@@ -5,18 +5,28 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import type {Options as DocsPluginOptions} from '@docusaurus/plugin-content-docs';
|
|
9
|
+
import type {Options as BlogPluginOptions} from '@docusaurus/plugin-content-blog';
|
|
10
|
+
import type {Options as PagesPluginOptions} from '@docusaurus/plugin-content-pages';
|
|
11
|
+
import type {Options as SitemapPluginOptions} from '@docusaurus/plugin-sitemap';
|
|
12
|
+
import type {Options as GAPluginOptions} from '@docusaurus/plugin-google-analytics';
|
|
13
|
+
import type {Options as GtagPluginOptions} from '@docusaurus/plugin-google-gtag';
|
|
14
|
+
import type {Options as ThemeOptions} from '@docusaurus/theme-classic';
|
|
15
|
+
import type {ThemeConfig as BaseThemeConfig} from '@docusaurus/types';
|
|
16
|
+
import type {UserThemeConfig as ClassicThemeConfig} from '@docusaurus/theme-common';
|
|
17
|
+
import type {UserThemeConfig as AlgoliaThemeConfig} from '@docusaurus/theme-search-algolia';
|
|
18
|
+
|
|
8
19
|
export type Options = {
|
|
9
20
|
debug?: boolean;
|
|
10
|
-
docs?: false |
|
|
11
|
-
blog?: false |
|
|
12
|
-
pages?: false |
|
|
13
|
-
sitemap?: false |
|
|
14
|
-
theme?:
|
|
15
|
-
googleAnalytics?:
|
|
16
|
-
gtag?:
|
|
21
|
+
docs?: false | DocsPluginOptions;
|
|
22
|
+
blog?: false | BlogPluginOptions;
|
|
23
|
+
pages?: false | PagesPluginOptions;
|
|
24
|
+
sitemap?: false | SitemapPluginOptions;
|
|
25
|
+
theme?: ThemeOptions;
|
|
26
|
+
googleAnalytics?: GAPluginOptions;
|
|
27
|
+
gtag?: GtagPluginOptions;
|
|
17
28
|
};
|
|
18
29
|
|
|
19
|
-
export type ThemeConfig =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
30
|
+
export type ThemeConfig = BaseThemeConfig &
|
|
31
|
+
ClassicThemeConfig &
|
|
32
|
+
AlgoliaThemeConfig;
|