feat(v2): allow home page for docs (#2652)

* feat(v2): allow home page for docs

* Refactor

* Remove debugging info 🤦‍♂️

* Add sort routes for first test case

* Sort child routes for consistency
This commit is contained in:
Alexey Pyltsyn 2020-05-17 12:48:02 +03:00 committed by GitHub
parent 393adc5324
commit 00a8e9e365
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 264 additions and 61 deletions

View file

@ -52,6 +52,10 @@ module.exports = function (context, options) {
Plugins should use the data loaded in `loadContent` and construct the pages/routes that consume the loaded data (optional).
## `async routesLoaded(routes)`
Plugins can modify the routes that were generated by all plugins. `routesLoaded` is called after `contentLoaded` hook.
### `content`
`contentLoaded` will be called _after_ `loadContent` is done, the return value of `loadContent()` will be passed to `contentLoaded` as `content`.
@ -373,6 +377,11 @@ module.exports = function (context, opts) {
// actions are set of functional API provided by Docusaurus. e.g: addRoute
},
async routesLoaded(routes) {
// routesLoaded hook is done after contentLoaded hook is done
// This can be useful if you need to change any route.
},
async postBuild(props) {
// after docusaurus <build> finish
},