mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-11 22:13:20 +03:00
abaf0461cf
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
23 lines
638 B
JavaScript
23 lines
638 B
JavaScript
var router = require('./lib/router'),
|
|
registerHelpers = require('./lib/helpers'),
|
|
|
|
// Dirty requires
|
|
config = require('../../config'),
|
|
settingsCache = require('../../settings/cache');
|
|
|
|
module.exports = {
|
|
activate: function activate(ghost) {
|
|
var ampRoute = '*/' + config.get('routeKeywords').amp + '/';
|
|
|
|
ghost.routeService.registerRouter(ampRoute, function settingsEnabledRouter(req, res, next) {
|
|
if (settingsCache.get('amp') === true) {
|
|
return router.apply(this, arguments);
|
|
}
|
|
|
|
next();
|
|
});
|
|
|
|
registerHelpers(ghost);
|
|
}
|
|
};
|