feat(v2): add editUrl option to docs plugin (#1818)

* feat(v2): add editUrl option to docs plugin

* nits

* misc(v2): nit

* misc(v2): nit
This commit is contained in:
Endi 2019-10-11 02:10:18 +08:00 committed by Yangshun Tay
parent aba9edc12c
commit ae678c9dad
10 changed files with 66 additions and 6 deletions

View file

@ -144,6 +144,10 @@ module.exports = {
* relative to site dir
*/
path: 'docs',
/**
* URL for editing docs, example: 'https://github.com/facebook/docusaurus/edit/master/website/docs/'
*/
editUrl: 'https://github.com/repo/project/website/docs/',
/**
* URL route for the blog section of your site
* do not include trailing slash

View file

@ -265,7 +265,7 @@ module.exports = {
Deprecated. Create a `CNAME` file in your `static` folder instead. Files in the `static` folder will be copied into the root of the `build` folder during execution of the build command.
#### `customDocsPath`, `docsUrl`
#### `customDocsPath`, `docsUrl`, `editUrl`
Deprecated. Pass it as an option to `@docusaurus/preset-classic` docs instead:
@ -279,6 +279,8 @@ module.exports = {
docs: {
// Equivalent to `customDocsPath`.
path: 'docs',
// Equivalent to `editUrl`
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/docs/',
// Equivalent to `docsUrl`.
routeBasePath: 'docs',
// Remark and Rehype plugins passed to MDX. Replaces `markdownOptions` and `markdownPlugins`.
@ -321,7 +323,6 @@ module.exports = {
### Deprecated fields that may be implemented using a plugin
- `enableUpdateBy`
- `editUrl`
- `enableUpdateTime`
- `scripts`
- `stylesheets`

View file

@ -32,6 +32,8 @@ module.exports = {
docs: {
path: 'docs',
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/docs/',
},
blog: {
path: '../website-1.x/blog',