mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
refs #5091, refs #9192 - There are several theme template "renderers" all over the codebase - Some are in apps, and were called "controllers" - One is in error handling - All of them now have comments marking out how they share logic/steps - Other comments describe routes & controllers where they live
22 lines
706 B
JavaScript
22 lines
706 B
JavaScript
var router = require('./lib/router'),
|
|
registerHelpers = require('./lib/helpers'),
|
|
|
|
// Dirty requires
|
|
config = require('../../config'),
|
|
labs = require('../../utils/labs');
|
|
|
|
module.exports = {
|
|
activate: function activate(ghost) {
|
|
var subscribeRoute = '/' + config.get('routeKeywords').subscribe + '/';
|
|
// TODO, how to do all this only if the Subscribers flag is set?!
|
|
registerHelpers(ghost);
|
|
|
|
ghost.routeService.registerRouter(subscribeRoute, function labsEnabledRouter(req, res, next) {
|
|
if (labs.isSet('subscribers') === true) {
|
|
return router.apply(this, arguments);
|
|
}
|
|
|
|
next();
|
|
});
|
|
}
|
|
};
|