Skip to content

Commit dbfabf4

Browse files
committed
Update docusaurus to v3
1 parent c77d97e commit dbfabf4

14 files changed

+182
-185
lines changed

packages/docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Website
22

3-
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
44

55
### Installation
66

packages/docs/docs/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new
1414

1515
### What you'll need
1616

17-
- [Node.js](https://nodejs.org/en/download/) version 16.14 or above:
17+
- [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
1818
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
1919

2020
## Generate a new site

packages/docs/docs/tutorial-basics/create-a-blog-post.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ tags: [greetings]
2828

2929
Congratulations, you have made your first post!
3030

31-
Feel free to play around and edit this post as much you like.
31+
Feel free to play around and edit this post as much as you like.
3232
```
3333

3434
A new blog post is now available at [http://localhost:3000/blog/greetings](http://localhost:3000/blog/greetings).

packages/docs/docs/tutorial-basics/create-a-document.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ This is my **first Docusaurus document**!
4242
It is also possible to create your sidebar explicitly in `sidebars.js`:
4343

4444
```js title="sidebars.js"
45-
module.exports = {
45+
export default {
4646
tutorialSidebar: [
4747
'intro',
4848
// highlight-next-line

packages/docs/docs/tutorial-basics/markdown-features.mdx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ You can reference images relative to the current file as well. This is particula
6161

6262
Markdown code blocks are supported with Syntax highlighting.
6363

64-
```jsx title="src/components/HelloDocusaurus.js"
65-
function HelloDocusaurus() {
66-
return (
67-
<h1>Hello, Docusaurus!</h1>
68-
)
69-
}
70-
```
64+
````md
65+
```jsx title="src/components/HelloDocusaurus.js"
66+
function HelloDocusaurus() {
67+
return <h1>Hello, Docusaurus!</h1>;
68+
}
69+
```
70+
````
7171

7272
```jsx title="src/components/HelloDocusaurus.js"
7373
function HelloDocusaurus() {
@@ -79,17 +79,19 @@ function HelloDocusaurus() {
7979

8080
Docusaurus has a special syntax to create admonitions and callouts:
8181

82-
:::tip My tip
82+
```md
83+
:::tip My tip
8384

84-
Use this awesome feature option
85+
Use this awesome feature option
8586

86-
:::
87+
:::
8788

88-
:::danger Take care
89+
:::danger Take care
8990

90-
This action is dangerous
91+
This action is dangerous
9192

92-
:::
93+
:::
94+
```
9395

9496
:::tip My tip
9597

packages/docs/docs/tutorial-extras/manage-docs-versions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To navigate seamlessly across versions, add a version dropdown.
2828
Modify the `docusaurus.config.js` file:
2929

3030
```js title="docusaurus.config.js"
31-
module.exports = {
31+
export default {
3232
themeConfig: {
3333
navbar: {
3434
items: [

packages/docs/docs/tutorial-extras/translate-your-site.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Let's translate `docs/intro.md` to French.
1111
Modify `docusaurus.config.js` to add support for the `fr` locale:
1212

1313
```js title="docusaurus.config.js"
14-
module.exports = {
14+
export default {
1515
i18n: {
1616
defaultLocale: 'en',
1717
locales: ['en', 'fr'],
@@ -43,7 +43,7 @@ Your localized site is accessible at [http://localhost:3000/fr/](http://localhos
4343

4444
:::caution
4545

46-
In development, you can only use one locale at a same time.
46+
In development, you can only use one locale at a time.
4747

4848
:::
4949

@@ -54,7 +54,7 @@ To navigate seamlessly across languages, add a locale dropdown.
5454
Modify the `docusaurus.config.js` file:
5555

5656
```js title="docusaurus.config.js"
57-
module.exports = {
57+
export default {
5858
themeConfig: {
5959
navbar: {
6060
items: [

packages/docs/docusaurus.config.js

Lines changed: 0 additions & 139 deletions
This file was deleted.

packages/docs/docusaurus.config.ts

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

0 commit comments

Comments
 (0)