mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-03 03:12:35 +02:00
docs(v2): fix outdated/ wrong info
This commit is contained in:
parent
d5ca17ffea
commit
7d5920b30c
3 changed files with 14 additions and 26 deletions
|
@ -177,14 +177,12 @@ $ yarn add @docusaurus/plugin-google-analytics
|
|||
```js
|
||||
// docusaurus.config.js
|
||||
module.exports = {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-google-analytics',
|
||||
{
|
||||
trackingID: 'UA-142857148-5',
|
||||
plugins: ['@docusaurus/plugin-google-analytics'],
|
||||
themeConfig: {
|
||||
googleAnalytics: {
|
||||
trackingID: 'UA-141789564-1',
|
||||
},
|
||||
],
|
||||
],
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
|
@ -203,14 +201,12 @@ $ yarn add @docusaurus/plugin-google-gtag
|
|||
```js
|
||||
// docusaurus.config.js
|
||||
module.exports = {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-google-gtag',
|
||||
{
|
||||
trackingID: 'UA-142857148-5',
|
||||
plugins: ['@docusaurus/plugin-google-gtag'],
|
||||
themeConfig: {
|
||||
gtag: {
|
||||
trackingID: 'UA-141789564-1',
|
||||
},
|
||||
],
|
||||
],
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ module.exports = {
|
|||
|
||||
## Passing options to Docusaurus plugins via preset
|
||||
|
||||
If you initialized your site using the classic template, you do not have to specify plugin options individually in your `docusaurus.config.js`. To provide the neccesary fields to certain plugins, i.e. `trackingID` for `@docusaurus/plugin-google-analytics`, pass them in the preset field, like this:
|
||||
If you initialized your site using the classic template, you do not have to specify plugin options individually in your `docusaurus.config.js`. To provide the neccesary fields to certain plugins, i.e. `customCss` for `@docusaurus/theme-classic`, pass them in the preset field, like this:
|
||||
|
||||
```js
|
||||
// docusaurus.config.js
|
||||
|
@ -73,18 +73,10 @@ module.exports = {
|
|||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
// Will be passed to @docusaurus/plugin-content-docs.
|
||||
docs: {
|
||||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
},
|
||||
// Will be passed to @docusaurus/theme-classic.
|
||||
theme: {
|
||||
customCss: require.resolve('./src/css/custom.css'),
|
||||
},
|
||||
// Will be passed to @docusaurus/plugin-google-analytics.
|
||||
googleAnalytics: {
|
||||
trackingID: 'UA-1428571428-5',
|
||||
},
|
||||
...
|
||||
},
|
||||
],
|
||||
|
|
|
@ -34,7 +34,7 @@ As an example, to swizzle the `<Footer />` component in `@docusaurus/theme-class
|
|||
$ npm swizzle @docusaurus/theme-classic Footer
|
||||
```
|
||||
|
||||
This will copy the current `<Footer />` component used by the theme to a `theme/Footer` directory under the root of your site, which is where Docusaurus will look for swizzled components. Docusaurus will then use swizzled component in place of the original one from the theme.
|
||||
This will copy the current `<Footer />` component used by the theme to a `src/theme/Footer` directory under the root of your site, which is where Docusaurus will look for swizzled components. Docusaurus will then use swizzled component in place of the original one from the theme.
|
||||
|
||||
**Note**: You need to restart your dev server for Docusaurus to pick up the new component.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue