create-docusaurus 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
@@ -325,8 +325,10 @@ async function updatePkg(pkgPath, obj) {
325
325
  await fs.outputFile(pkgPath, `${JSON.stringify(newPkg, null, 2)}\n`);
326
326
  }
327
327
  export default async function init(rootDir, reqName, reqTemplate, cliOptions = {}) {
328
- const templates = await readTemplates();
329
- const siteName = await getSiteName(reqName, rootDir);
328
+ const [templates, siteName] = await Promise.all([
329
+ readTemplates(),
330
+ getSiteName(reqName, rootDir),
331
+ ]);
330
332
  const dest = path.resolve(rootDir, siteName);
331
333
  const source = await getSource(reqTemplate, templates, cliOptions);
332
334
  logger.info('Creating new Docusaurus project...');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-docusaurus",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
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": "2.1.0",
26
- "@docusaurus/utils": "2.1.0",
25
+ "@docusaurus/logger": "2.3.0",
26
+ "@docusaurus/utils": "2.3.0",
27
27
  "commander": "^5.1.0",
28
28
  "fs-extra": "^10.1.0",
29
29
  "lodash": "^4.17.21",
@@ -39,5 +39,5 @@
39
39
  "engines": {
40
40
  "node": ">=16.14"
41
41
  },
42
- "gitHead": "be9b0942641184213485eba7fd75ceb0b328d3f4"
42
+ "gitHead": "ad477781bdca6a11fa9c6daef5048bdcec0ee37e"
43
43
  }
@@ -8,17 +8,22 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
8
8
  const config = {
9
9
  title: 'My Site',
10
10
  tagline: 'Dinosaurs are cool',
11
+ favicon: 'img/favicon.ico',
12
+
13
+ // Set the production url of your site here
11
14
  url: 'https://your-docusaurus-test-site.com',
15
+ // Set the /<baseUrl>/ pathname under which your site is served
16
+ // For GitHub pages deployment, it is often '/<projectName>/'
12
17
  baseUrl: '/',
13
- onBrokenLinks: 'throw',
14
- onBrokenMarkdownLinks: 'warn',
15
- favicon: 'img/favicon.ico',
16
18
 
17
19
  // GitHub pages deployment config.
18
20
  // If you aren't using GitHub pages, you don't need these.
19
21
  organizationName: 'facebook', // Usually your GitHub org/user name.
20
22
  projectName: 'docusaurus', // Usually your repo name.
21
23
 
24
+ onBrokenLinks: 'throw',
25
+ onBrokenMarkdownLinks: 'warn',
26
+
22
27
  // Even if you don't use internalization, you can use this field to set useful
23
28
  // metadata like html lang. For example, if your site is Chinese, you may want
24
29
  // to replace "en" with "zh-Hans".
@@ -56,6 +61,8 @@ const config = {
56
61
  themeConfig:
57
62
  /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
58
63
  ({
64
+ // Replace with your project's social card
65
+ image: 'img/docusaurus-social-card.jpg',
59
66
  navbar: {
60
67
  title: 'My Site',
61
68
  logo: {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-2-classic-template",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
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": "2.1.0",
18
- "@docusaurus/preset-classic": "2.1.0",
17
+ "@docusaurus/core": "2.3.0",
18
+ "@docusaurus/preset-classic": "2.3.0",
19
19
  "@mdx-js/react": "^1.6.22",
20
20
  "clsx": "^1.2.1",
21
21
  "prism-react-renderer": "^1.3.5",
@@ -23,7 +23,7 @@
23
23
  "react-dom": "^17.0.2"
24
24
  },
25
25
  "devDependencies": {
26
- "@docusaurus/module-type-aliases": "2.1.0"
26
+ "@docusaurus/module-type-aliases": "2.3.0"
27
27
  },
28
28
  "browserslist": {
29
29
  "production": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-2-classic-typescript-template",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
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": "2.1.0",
19
- "@docusaurus/preset-classic": "2.1.0",
18
+ "@docusaurus/core": "2.3.0",
19
+ "@docusaurus/preset-classic": "2.3.0",
20
20
  "@mdx-js/react": "^1.6.22",
21
21
  "clsx": "^1.2.1",
22
22
  "prism-react-renderer": "^1.3.5",
@@ -24,7 +24,7 @@
24
24
  "react-dom": "^17.0.2"
25
25
  },
26
26
  "devDependencies": {
27
- "@docusaurus/module-type-aliases": "2.1.0",
27
+ "@docusaurus/module-type-aliases": "2.3.0",
28
28
  "@tsconfig/docusaurus": "^1.0.5",
29
29
  "typescript": "^4.7.4"
30
30
  },
@@ -13,17 +13,22 @@
13
13
  const config = {
14
14
  title: 'My Site',
15
15
  tagline: 'The tagline of my site',
16
+ favicon: 'img/favicon.ico',
17
+
18
+ // Set the production url of your site here
16
19
  url: 'https://your-docusaurus-test-site.com',
20
+ // Set the /<baseUrl>/ pathname under which your site is served
21
+ // For GitHub pages deployment, it is often '/<projectName>/'
17
22
  baseUrl: '/',
18
- onBrokenLinks: 'throw',
19
- onBrokenMarkdownLinks: 'warn',
20
- favicon: 'img/favicon.ico',
21
23
 
22
24
  // GitHub pages deployment config.
23
25
  // If you aren't using GitHub pages, you don't need these.
24
26
  organizationName: 'facebook', // Usually your GitHub org/user name.
25
27
  projectName: 'docusaurus', // Usually your repo name.
26
28
 
29
+ onBrokenLinks: 'throw',
30
+ onBrokenMarkdownLinks: 'warn',
31
+
27
32
  presets: [
28
33
  [
29
34
  'classic',
@@ -53,6 +58,7 @@ const config = {
53
58
  themeConfig:
54
59
  /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
55
60
  ({
61
+ image: 'img/docusaurus-social-card.jpg',
56
62
  navbar: {
57
63
  title: 'My Meta Project',
58
64
  logo: {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-2-facebook-template",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "docusaurus": "docusaurus",
@@ -18,8 +18,8 @@
18
18
  "format:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,md,mdx}\""
19
19
  },
20
20
  "dependencies": {
21
- "@docusaurus/core": "2.1.0",
22
- "@docusaurus/preset-classic": "2.1.0",
21
+ "@docusaurus/core": "2.3.0",
22
+ "@docusaurus/preset-classic": "2.3.0",
23
23
  "@mdx-js/react": "^1.6.22",
24
24
  "clsx": "^1.2.1",
25
25
  "react": "^17.0.2",
@@ -51,7 +51,11 @@ You can use absolute paths to reference images in the static directory (`static/
51
51
 
52
52
  ![Docusaurus logo](/img/docusaurus.png)
53
53
 
54
- You can reference images relative to the current file as well, as shown in [the extra guides](../tutorial-extras/manage-docs-versions.md).
54
+ You can reference images relative to the current file as well. This is particularly useful to colocate images close to the Markdown files using them:
55
+
56
+ ```md
57
+ ![Docusaurus logo](./img/docusaurus.png)
58
+ ```
55
59
 
56
60
  ## Code Blocks
57
61