0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/controllers/frontend/render-channel.js

18 lines
567 B
JavaScript
Raw Normal View History

var debug = require('ghost-ignition').debug('channels:render'),
formatResponse = require('./format-response'),
setResponseContext = require('./context'),
templates = require('./templates');
module.exports = function renderChannel(req, res) {
debug('renderChannel called');
return function renderChannel(result) {
var view = templates.channel(res.locals.channel);
result = formatResponse.channel(result);
setResponseContext(req, res);
debug('Rendering view: ' + view);
res.render(view, result);
};
};