mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Dynamic Routing Beta: Reordered router hierarchy
refs #9601 - static routes are stronger than taxonomy
This commit is contained in:
parent
3cdff10350
commit
d0f2b3e7ad
1 changed files with 7 additions and 7 deletions
14
core/server/services/routing/bootstrap.js
vendored
14
core/server/services/routing/bootstrap.js
vendored
|
@ -32,13 +32,6 @@ module.exports = function bootstrap() {
|
|||
|
||||
const dynamicRoutes = settingsService.get('routes');
|
||||
|
||||
_.each(dynamicRoutes.taxonomies, (value, key) => {
|
||||
const taxonomyRouter = new TaxonomyRouter(key, value);
|
||||
siteRouter.mountRouter(taxonomyRouter.router());
|
||||
|
||||
registry.setRouter(taxonomyRouter.identifier, taxonomyRouter);
|
||||
});
|
||||
|
||||
_.each(dynamicRoutes.routes, (value, key) => {
|
||||
const staticRoutesRouter = new StaticRoutesRouter(key, value);
|
||||
siteRouter.mountRouter(staticRoutesRouter.router());
|
||||
|
@ -46,6 +39,13 @@ module.exports = function bootstrap() {
|
|||
registry.setRouter(staticRoutesRouter.identifier, staticRoutesRouter);
|
||||
});
|
||||
|
||||
_.each(dynamicRoutes.taxonomies, (value, key) => {
|
||||
const taxonomyRouter = new TaxonomyRouter(key, value);
|
||||
siteRouter.mountRouter(taxonomyRouter.router());
|
||||
|
||||
registry.setRouter(taxonomyRouter.identifier, taxonomyRouter);
|
||||
});
|
||||
|
||||
_.each(dynamicRoutes.collections, (value, key) => {
|
||||
const collectionRouter = new CollectionRouter(key, value);
|
||||
siteRouter.mountRouter(collectionRouter.router());
|
||||
|
|
Loading…
Reference in a new issue