mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
5dac1c97fc
refs #5091, refs #9192 - render channel was always a weird file - now it's clearly 2 things - we're slowly getting towards closing #5091... 🎉 - added some extra tests
17 lines
567 B
JavaScript
17 lines
567 B
JavaScript
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);
|
|
};
|
|
};
|