2015-12-07 23:06:35 +03:00
|
|
|
var _ = require('lodash'),
|
|
|
|
config = require('../../config'),
|
2016-02-09 17:14:24 +03:00
|
|
|
channelConfig;
|
2015-10-25 23:00:29 +03:00
|
|
|
|
2016-02-09 17:14:24 +03:00
|
|
|
channelConfig = function channelConfig() {
|
2015-12-07 23:06:35 +03:00
|
|
|
var defaults = {
|
|
|
|
index: {
|
|
|
|
name: 'index',
|
|
|
|
route: '/',
|
|
|
|
frontPageTemplate: 'home'
|
2015-10-25 23:00:29 +03:00
|
|
|
},
|
2015-12-07 23:06:35 +03:00
|
|
|
tag: {
|
|
|
|
name: 'tag',
|
2016-09-13 18:41:14 +03:00
|
|
|
route: '/' + config.get('routeKeywords').tag + '/:slug/',
|
2015-12-07 23:06:35 +03:00
|
|
|
postOptions: {
|
2015-12-20 17:46:43 +03:00
|
|
|
filter: 'tags:\'%s\''
|
2015-12-07 23:06:35 +03:00
|
|
|
},
|
|
|
|
data: {
|
|
|
|
tag: {
|
|
|
|
type: 'read',
|
|
|
|
resource: 'tags',
|
|
|
|
options: {slug: '%s'}
|
|
|
|
}
|
|
|
|
},
|
2016-02-09 17:14:24 +03:00
|
|
|
slugTemplate: true,
|
|
|
|
editRedirect: '/ghost/settings/tags/:slug/'
|
2015-10-25 23:00:29 +03:00
|
|
|
},
|
2015-12-07 23:06:35 +03:00
|
|
|
author: {
|
|
|
|
name: 'author',
|
2016-09-13 18:41:14 +03:00
|
|
|
route: '/' + config.get('routeKeywords').author + '/:slug/',
|
2015-12-07 23:06:35 +03:00
|
|
|
postOptions: {
|
2015-12-20 17:46:43 +03:00
|
|
|
filter: 'author:\'%s\''
|
2015-12-07 23:06:35 +03:00
|
|
|
},
|
|
|
|
data: {
|
|
|
|
author: {
|
|
|
|
type: 'read',
|
|
|
|
resource: 'users',
|
|
|
|
options: {slug: '%s'}
|
|
|
|
}
|
|
|
|
},
|
2016-02-09 17:14:24 +03:00
|
|
|
slugTemplate: true,
|
|
|
|
editRedirect: '/ghost/team/:slug/'
|
2015-12-07 23:06:35 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-02-09 17:14:24 +03:00
|
|
|
return defaults;
|
2015-10-25 23:00:29 +03:00
|
|
|
};
|
|
|
|
|
2016-02-09 17:14:24 +03:00
|
|
|
module.exports.list = function list() {
|
|
|
|
return channelConfig();
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports.get = function get(name) {
|
|
|
|
return _.cloneDeep(channelConfig()[name]);
|
|
|
|
};
|