mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
9d7049cd3f
- The helper registration code is "framework" code and very specific - At the moment the "theme engine" is full of lots of disparate theme related stuff - I'm trying to make the frontend framework code clearer and also expand it to make it more useful - The helper system now also exposes 3 methods allowing you to register a directory, a helper or an alias - I've updated the codebase to use these both for our core helpers and for "apps"
20 lines
740 B
JavaScript
20 lines
740 B
JavaScript
const helperService = require('../../services/helpers');
|
|
const routingService = require('../../services/routing');
|
|
|
|
module.exports.getInstance = function getInstance() {
|
|
const appRouter = routingService.registry.getRouter('appRouter');
|
|
|
|
return {
|
|
helperService: {
|
|
registerAlias: helperService.registerAlias.bind(helperService),
|
|
registerHelper: helperService.registerHelper.bind(helperService),
|
|
registerDir: helperService.registerDir.bind(helperService)
|
|
},
|
|
// Expose the route service...
|
|
routeService: {
|
|
// This allows for mounting an entirely new Router at a path...
|
|
registerRouter: appRouter.mountRouter.bind(appRouter)
|
|
}
|
|
};
|
|
};
|