0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/server/apps/subscribers/index.js

24 lines
825 B
JavaScript
Raw Normal View History

var _ = require('lodash'),
path = require('path'),
config = require('../../config'),
router = require('./lib/router'),
// Dirty require
template = require('../../helpers/template');
module.exports = {
activate: function activate(ghost) {
// Correct way to register a helper from an app
ghost.helpers.register('form_subscribe', function formSubscribeHelper(options) {
var data = _.merge({}, options.hash, {
action: path.join('/', config.paths.subdir, config.routeKeywords.subscribe, '/')
});
return template.execute('form_subscribe', data, options);
});
},
setupRoutes: function setupRoutes(blogRouter) {
blogRouter.use('/' + config.routeKeywords.subscribe + '/', router);
}
};