2015-12-07 23:06:35 +03:00
|
|
|
var _ = require('lodash'),
|
|
|
|
config = require('../../config'),
|
2016-11-14 17:38:55 +03:00
|
|
|
utils = require('../../utils'),
|
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-11-14 17:38:55 +03:00
|
|
|
route: utils.url.urlJoin('/', config.get('routeKeywords').tag, ':slug/'),
|
2015-12-07 23:06:35 +03:00
|
|
|
postOptions: {
|
2016-10-10 11:51:03 +03:00
|
|
|
filter: 'tags:\'%s\'+tags.visibility:\'public\''
|
2015-12-07 23:06:35 +03:00
|
|
|
},
|
|
|
|
data: {
|
|
|
|
tag: {
|
|
|
|
type: 'read',
|
|
|
|
resource: 'tags',
|
2016-10-10 11:51:03 +03:00
|
|
|
options: {slug: '%s', visibility: 'public'}
|
2015-12-07 23:06:35 +03:00
|
|
|
}
|
|
|
|
},
|
2016-02-09 17:14:24 +03:00
|
|
|
slugTemplate: true,
|
2017-03-14 19:03:30 +03:00
|
|
|
editRedirect: utils.url.urlJoin(utils.url.urlFor('admin'), '#/settings/tags/:slug/')
|
2015-10-25 23:00:29 +03:00
|
|
|
},
|
2015-12-07 23:06:35 +03:00
|
|
|
author: {
|
|
|
|
name: 'author',
|
2016-11-14 17:38:55 +03:00
|
|
|
route: utils.url.urlJoin('/', 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,
|
2017-03-14 19:03:30 +03:00
|
|
|
editRedirect: utils.url.urlJoin(utils.url.urlFor('admin'), '#/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]);
|
|
|
|
};
|