create-docusaurus 0.0.0-5703 → 0.0.0-5709

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
@@ -95,15 +95,6 @@ async function readTemplates() {
95
95
  }
96
96
  async function copyTemplate(template, dest, typescript) {
97
97
  await fs.copy(path.join(templatesDir, 'shared'), dest);
98
- // TypeScript variants will copy duplicate resources like CSS & config from
99
- // base template
100
- if (typescript) {
101
- await fs.copy(template.path, dest, {
102
- filter: async (filePath) => (await fs.stat(filePath)).isDirectory() ||
103
- path.extname(filePath) === '.css' ||
104
- path.basename(filePath) === 'docusaurus.config.js',
105
- });
106
- }
107
98
  await fs.copy(typescript ? template.tsVariantPath : template.path, dest, {
108
99
  // Symlinks don't exist in published npm packages anymore, so this is only
109
100
  // to prevent errors during local testing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-docusaurus",
3
- "version": "0.0.0-5703",
3
+ "version": "0.0.0-5709",
4
4
  "description": "Create Docusaurus apps easily.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@docusaurus/logger": "0.0.0-5703",
26
- "@docusaurus/utils": "0.0.0-5703",
25
+ "@docusaurus/logger": "0.0.0-5709",
26
+ "@docusaurus/utils": "0.0.0-5709",
27
27
  "commander": "^5.1.0",
28
28
  "fs-extra": "^11.1.1",
29
29
  "lodash": "^4.17.21",
@@ -39,5 +39,5 @@
39
39
  "engines": {
40
40
  "node": ">=18.0"
41
41
  },
42
- "gitHead": "b6502cb137998f5080cb59141cdc8979bbf4ce62"
42
+ "gitHead": "74bd580af9d340c0186f1934c26973cf50d0d7ec"
43
43
  }
@@ -4,10 +4,7 @@
4
4
  // There are various equivalent ways to declare your Docusaurus config.
5
5
  // See: https://docusaurus.io/docs/api/docusaurus-config
6
6
 
7
- const {themes} = require('prism-react-renderer');
8
-
9
- const lightCodeTheme = themes.github;
10
- const darkCodeTheme = themes.dracula;
7
+ import {themes as prismThemes} from 'prism-react-renderer';
11
8
 
12
9
  /** @type {import('@docusaurus/types').Config} */
13
10
  const config = {
@@ -43,7 +40,7 @@ const config = {
43
40
  /** @type {import('@docusaurus/preset-classic').Options} */
44
41
  ({
45
42
  docs: {
46
- sidebarPath: require.resolve('./sidebars.js'),
43
+ sidebarPath: './sidebars.js',
47
44
  // Please change this to your repo.
48
45
  // Remove this to remove the "edit this page" links.
49
46
  editUrl:
@@ -57,7 +54,7 @@ const config = {
57
54
  'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
58
55
  },
59
56
  theme: {
60
- customCss: require.resolve('./src/css/custom.css'),
57
+ customCss: './src/css/custom.css',
61
58
  },
62
59
  }),
63
60
  ],
@@ -135,10 +132,10 @@ const config = {
135
132
  copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
136
133
  },
137
134
  prism: {
138
- theme: lightCodeTheme,
139
- darkTheme: darkCodeTheme,
135
+ theme: prismThemes.github,
136
+ darkTheme: prismThemes.dracula,
140
137
  },
141
138
  }),
142
139
  };
143
140
 
144
- module.exports = config;
141
+ export default config;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-2-classic-template",
3
- "version": "0.0.0-5703",
3
+ "version": "0.0.0-5709",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "docusaurus": "docusaurus",
@@ -14,8 +14,8 @@
14
14
  "write-heading-ids": "docusaurus write-heading-ids"
15
15
  },
16
16
  "dependencies": {
17
- "@docusaurus/core": "0.0.0-5703",
18
- "@docusaurus/preset-classic": "0.0.0-5703",
17
+ "@docusaurus/core": "0.0.0-5709",
18
+ "@docusaurus/preset-classic": "0.0.0-5709",
19
19
  "@mdx-js/react": "^2.3.0",
20
20
  "clsx": "^1.2.1",
21
21
  "prism-react-renderer": "^2.1.0",
@@ -23,7 +23,8 @@
23
23
  "react-dom": "^18.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@docusaurus/module-type-aliases": "0.0.0-5703"
26
+ "@docusaurus/module-type-aliases": "0.0.0-5709",
27
+ "@docusaurus/types": "0.0.0-5709"
27
28
  },
28
29
  "browserslist": {
29
30
  "production": [
@@ -30,4 +30,4 @@ const sidebars = {
30
30
  */
31
31
  };
32
32
 
33
- module.exports = sidebars;
33
+ export default sidebars;
@@ -0,0 +1,133 @@
1
+ import {themes as prismThemes} from 'prism-react-renderer';
2
+ import type {Config} from '@docusaurus/types';
3
+ import type * as Preset from '@docusaurus/preset-classic';
4
+
5
+ const config: Config = {
6
+ title: 'My Site',
7
+ tagline: 'Dinosaurs are cool',
8
+ favicon: 'img/favicon.ico',
9
+
10
+ // Set the production url of your site here
11
+ url: 'https://your-docusaurus-site.example.com',
12
+ // Set the /<baseUrl>/ pathname under which your site is served
13
+ // For GitHub pages deployment, it is often '/<projectName>/'
14
+ baseUrl: '/',
15
+
16
+ // GitHub pages deployment config.
17
+ // If you aren't using GitHub pages, you don't need these.
18
+ organizationName: 'facebook', // Usually your GitHub org/user name.
19
+ projectName: 'docusaurus', // Usually your repo name.
20
+
21
+ onBrokenLinks: 'throw',
22
+ onBrokenMarkdownLinks: 'warn',
23
+
24
+ // Even if you don't use internationalization, you can use this field to set
25
+ // useful metadata like html lang. For example, if your site is Chinese, you
26
+ // may want to replace "en" with "zh-Hans".
27
+ i18n: {
28
+ defaultLocale: 'en',
29
+ locales: ['en'],
30
+ },
31
+
32
+ presets: [
33
+ [
34
+ 'classic',
35
+ {
36
+ docs: {
37
+ sidebarPath: './sidebars.ts',
38
+ // Please change this to your repo.
39
+ // Remove this to remove the "edit this page" links.
40
+ editUrl:
41
+ 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
42
+ },
43
+ blog: {
44
+ showReadingTime: true,
45
+ // Please change this to your repo.
46
+ // Remove this to remove the "edit this page" links.
47
+ editUrl:
48
+ 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
49
+ },
50
+ theme: {
51
+ customCss: './src/css/custom.css',
52
+ },
53
+ } satisfies Preset.Options,
54
+ ],
55
+ ],
56
+
57
+ themeConfig: {
58
+ // Replace with your project's social card
59
+ image: 'img/docusaurus-social-card.jpg',
60
+ navbar: {
61
+ title: 'My Site',
62
+ logo: {
63
+ alt: 'My Site Logo',
64
+ src: 'img/logo.svg',
65
+ },
66
+ items: [
67
+ {
68
+ type: 'docSidebar',
69
+ sidebarId: 'tutorialSidebar',
70
+ position: 'left',
71
+ label: 'Tutorial',
72
+ },
73
+ {to: '/blog', label: 'Blog', position: 'left'},
74
+ {
75
+ href: 'https://github.com/facebook/docusaurus',
76
+ label: 'GitHub',
77
+ position: 'right',
78
+ },
79
+ ],
80
+ },
81
+ footer: {
82
+ style: 'dark',
83
+ links: [
84
+ {
85
+ title: 'Docs',
86
+ items: [
87
+ {
88
+ label: 'Tutorial',
89
+ to: '/docs/intro',
90
+ },
91
+ ],
92
+ },
93
+ {
94
+ title: 'Community',
95
+ items: [
96
+ {
97
+ label: 'Stack Overflow',
98
+ href: 'https://stackoverflow.com/questions/tagged/docusaurus',
99
+ },
100
+ {
101
+ label: 'Discord',
102
+ href: 'https://discordapp.com/invite/docusaurus',
103
+ },
104
+ {
105
+ label: 'Twitter',
106
+ href: 'https://twitter.com/docusaurus',
107
+ },
108
+ ],
109
+ },
110
+ {
111
+ title: 'More',
112
+ items: [
113
+ {
114
+ label: 'Blog',
115
+ to: '/blog',
116
+ },
117
+ {
118
+ label: 'GitHub',
119
+ href: 'https://github.com/facebook/docusaurus',
120
+ },
121
+ ],
122
+ },
123
+ ],
124
+ copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
125
+ },
126
+ prism: {
127
+ theme: prismThemes.github,
128
+ darkTheme: prismThemes.dracula,
129
+ },
130
+ } satisfies Preset.ThemeConfig,
131
+ };
132
+
133
+ export default config;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-2-classic-typescript-template",
3
- "version": "0.0.0-5703",
3
+ "version": "0.0.0-5709",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "docusaurus": "docusaurus",
@@ -15,8 +15,8 @@
15
15
  "typecheck": "tsc"
16
16
  },
17
17
  "dependencies": {
18
- "@docusaurus/core": "0.0.0-5703",
19
- "@docusaurus/preset-classic": "0.0.0-5703",
18
+ "@docusaurus/core": "0.0.0-5709",
19
+ "@docusaurus/preset-classic": "0.0.0-5709",
20
20
  "@mdx-js/react": "^2.3.0",
21
21
  "clsx": "^1.2.1",
22
22
  "prism-react-renderer": "^2.1.0",
@@ -24,8 +24,9 @@
24
24
  "react-dom": "^18.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@docusaurus/module-type-aliases": "0.0.0-5703",
28
- "@docusaurus/tsconfig": "0.0.0-5703",
27
+ "@docusaurus/module-type-aliases": "0.0.0-5709",
28
+ "@docusaurus/tsconfig": "0.0.0-5709",
29
+ "@docusaurus/types": "0.0.0-5709",
29
30
  "typescript": "~5.2.2"
30
31
  },
31
32
  "browserslist": {
@@ -0,0 +1,31 @@
1
+ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
2
+
3
+ /**
4
+ * Creating a sidebar enables you to:
5
+ - create an ordered group of docs
6
+ - render a sidebar for each doc of that group
7
+ - provide next/previous navigation
8
+
9
+ The sidebars can be generated from the filesystem, or explicitly defined here.
10
+
11
+ Create as many sidebars as you want.
12
+ */
13
+ const sidebars: SidebarsConfig = {
14
+ // By default, Docusaurus generates a sidebar from the docs folder structure
15
+ tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
16
+
17
+ // But you can create a sidebar manually
18
+ /*
19
+ tutorialSidebar: [
20
+ 'intro',
21
+ 'hello',
22
+ {
23
+ type: 'category',
24
+ label: 'Tutorial',
25
+ items: ['tutorial-basics/create-a-document'],
26
+ },
27
+ ],
28
+ */
29
+ };
30
+
31
+ export default sidebars;
@@ -42,7 +42,7 @@ This is my **first Docusaurus document**!
42
42
  It is also possible to create your sidebar explicitly in `sidebars.js`:
43
43
 
44
44
  ```js title="sidebars.js"
45
- module.exports = {
45
+ export default {
46
46
  tutorialSidebar: [
47
47
  'intro',
48
48
  // highlight-next-line
@@ -28,7 +28,7 @@ To navigate seamlessly across versions, add a version dropdown.
28
28
  Modify the `docusaurus.config.js` file:
29
29
 
30
30
  ```js title="docusaurus.config.js"
31
- module.exports = {
31
+ export default {
32
32
  themeConfig: {
33
33
  navbar: {
34
34
  items: [
@@ -11,7 +11,7 @@ Let's translate `docs/intro.md` to French.
11
11
  Modify `docusaurus.config.js` to add support for the `fr` locale:
12
12
 
13
13
  ```js title="docusaurus.config.js"
14
- module.exports = {
14
+ export default {
15
15
  i18n: {
16
16
  defaultLocale: 'en',
17
17
  locales: ['en', 'fr'],
@@ -54,7 +54,7 @@ To navigate seamlessly across languages, add a locale dropdown.
54
54
  Modify the `docusaurus.config.js` file:
55
55
 
56
56
  ```js title="docusaurus.config.js"
57
- module.exports = {
57
+ export default {
58
58
  themeConfig: {
59
59
  navbar: {
60
60
  items: [