Ghost/core/server/controllers/frontend/channel-config.js

48 lines
1.2 KiB
JavaScript
Raw Normal View History

var _ = require('lodash'),
config = require('../../config'),
getConfig;
getConfig = function getConfig(name) {
var defaults = {
index: {
name: 'index',
route: '/',
frontPageTemplate: 'home'
},
tag: {
name: 'tag',
route: '/' + config.routeKeywords.tag + '/:slug/',
postOptions: {
filter: 'tags:\'%s\''
},
data: {
tag: {
type: 'read',
resource: 'tags',
options: {slug: '%s'}
}
},
slugTemplate: true
},
author: {
name: 'author',
route: '/' + config.routeKeywords.author + '/:slug/',
postOptions: {
filter: 'author:\'%s\''
},
data: {
author: {
type: 'read',
resource: 'users',
options: {slug: '%s'}
}
},
slugTemplate: true
}
};
return _.cloneDeep(defaults[name]);
};
module.exports = getConfig;