mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
05729d2f29
refs #5091 - Move all of the code to do with handling channels into one folder - Still keeping all the shared/simlar code for rendering etc inside weird frontend folder until I am sure what this will look like
27 lines
837 B
JavaScript
27 lines
837 B
JavaScript
var _ = require('lodash'),
|
|
channels = [];
|
|
|
|
function loadConfig() {
|
|
var channelConfig = {};
|
|
|
|
// This is a very dirty temporary hack so that we can test out channels with some Beta testers
|
|
// If you are reading this code, and considering using it, best reach out to us on Slack
|
|
// Definitely don't be angry at us if the structure of the JSON changes or this goes away.
|
|
try {
|
|
channelConfig = require('../../../../config.channels.json');
|
|
} catch (err) {
|
|
channelConfig = require('./config.channels.json');
|
|
}
|
|
|
|
return channelConfig;
|
|
}
|
|
|
|
module.exports.list = function list() {
|
|
_.each(loadConfig(), function (channelConfig, channelName) {
|
|
var channel = _.cloneDeep(channelConfig);
|
|
channel.name = channelName;
|
|
channels.push(channel);
|
|
});
|
|
|
|
return channels;
|
|
};
|