mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-24 12:07:58 +02:00
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:
parent
393adc5324
commit
00a8e9e365
12 changed files with 264 additions and 61 deletions
|
@ -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
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue