mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 16:59:06 +02:00
docs(v2): proofread docs (#2527)
This commit is contained in:
parent
692ab14e4f
commit
3dd83be988
14 changed files with 118 additions and 95 deletions
|
@ -17,10 +17,10 @@ To remove the ability to switch on dark mode, there is an option `themeConfig.di
|
|||
|
||||
```js {4} title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
...
|
||||
// ...
|
||||
themeConfig: {
|
||||
disableDarkMode: false,
|
||||
...
|
||||
// ...
|
||||
},
|
||||
};
|
||||
```
|
||||
|
@ -31,14 +31,14 @@ You can configure a default image that will be used for your meta tag, in partic
|
|||
|
||||
```js {4-6} title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
...
|
||||
// ...
|
||||
themeConfig: {
|
||||
// Relative to your site's "static" directory.
|
||||
// Cannot be SVGs. Can be external URLs too.
|
||||
image: 'img/docusaurus.png',
|
||||
...
|
||||
// ...
|
||||
},
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
### Announcement bar
|
||||
|
@ -47,17 +47,18 @@ Sometimes you want to announce something in your website. Just for such a case,
|
|||
|
||||
```js {4-9} title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
...
|
||||
// ...
|
||||
themeConfig: {
|
||||
announcementBar: {
|
||||
id: 'support_us', // Any value that will identify this message
|
||||
content: 'We are looking to revamp our docs, please fill <a target="_blank" rel="noopener noreferrer" href="#">this survey</a>',
|
||||
content:
|
||||
'We are looking to revamp our docs, please fill <a target="_blank" rel="noopener noreferrer" href="#">this survey</a>',
|
||||
backgroundColor: '#fafbfc', // Defaults to `#fff`
|
||||
textColor: '#091E42', // Defaults to `#000`
|
||||
},
|
||||
...
|
||||
// ...
|
||||
},
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## Hooks
|
||||
|
@ -91,7 +92,7 @@ To improve dark mode support, you can also set a different logo for this mode.
|
|||
|
||||
```js {5-11} title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
...
|
||||
// ...
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
title: 'Site Title',
|
||||
|
@ -103,9 +104,9 @@ module.exports = {
|
|||
target: '_self', // by default, this value is calculated based on the `href` attribute (the external link will open in a new tab, all others in the current one)
|
||||
},
|
||||
},
|
||||
...
|
||||
// ...
|
||||
},
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
### Navbar Links
|
||||
|
@ -114,7 +115,7 @@ You can add links to the navbar via `themeConfig.navbar.links`:
|
|||
|
||||
```js {5-15} title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
...
|
||||
// ...
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
links: [
|
||||
|
@ -129,9 +130,9 @@ module.exports = {
|
|||
// ... other links
|
||||
],
|
||||
},
|
||||
...
|
||||
// ...
|
||||
},
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
Outbound links automatically get `target="_blank" rel="noopener noreferrer"` attributes.
|
||||
|
@ -142,7 +143,7 @@ Navbar items can also be dropdown items by specifying the `items`, an inner arra
|
|||
|
||||
```js {9-19} title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
...
|
||||
// ...
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
links: [
|
||||
|
@ -163,9 +164,9 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
...
|
||||
// ...
|
||||
},
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
### Auto-hide sticky navbar
|
||||
|
@ -174,14 +175,14 @@ You can enable this cool UI feature that automatically hides the navbar when a u
|
|||
|
||||
```js {5} title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
...
|
||||
// ...
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
hideOnScroll: true,
|
||||
},
|
||||
...
|
||||
// ...
|
||||
},
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## Footer
|
||||
|
@ -194,13 +195,15 @@ Docusaurus uses [Prism React Renderer](https://github.com/FormidableLabs/prism-r
|
|||
|
||||
By default, we use [Palenight](https://github.com/FormidableLabs/prism-react-renderer/blob/master/src/themes/palenight.js) as syntax highlighting theme. You can specify a custom theme from the [list of available themes](https://github.com/FormidableLabs/prism-react-renderer/tree/master/src/themes). If you want to use a different syntax highlighting theme when the site is in dark mode, you may also do so.
|
||||
|
||||
```js {4-5} title="docusaurus.config.js"
|
||||
```js {5-6} title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
// ...
|
||||
themeConfig: {
|
||||
prism: {
|
||||
theme: require('prism-react-renderer/themes/github'),
|
||||
darkTheme: require('prism-react-renderer/themes/dracula'),
|
||||
},
|
||||
// ...
|
||||
},
|
||||
};
|
||||
```
|
||||
|
@ -213,12 +216,12 @@ You can set a default language for code blocks if no language is added after the
|
|||
|
||||
```js {5} title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
...
|
||||
// ...
|
||||
themeConfig: {
|
||||
prism: {
|
||||
defaultLanguage: 'javascript',
|
||||
},
|
||||
...
|
||||
// ...
|
||||
},
|
||||
};
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue