mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-16 12:16:09 +03:00
0ae0a0b490
refs #6982 - a replace for all config usages - always use config.get or config.set - this a pure replacement, no logic has changed [ci skip]
56 lines
1.4 KiB
JavaScript
56 lines
1.4 KiB
JavaScript
var _ = require('lodash'),
|
|
config = require('../../config'),
|
|
channelConfig;
|
|
|
|
channelConfig = function channelConfig() {
|
|
var defaults = {
|
|
index: {
|
|
name: 'index',
|
|
route: '/',
|
|
frontPageTemplate: 'home'
|
|
},
|
|
tag: {
|
|
name: 'tag',
|
|
route: '/' + config.get('routeKeywords').tag + '/:slug/',
|
|
postOptions: {
|
|
filter: 'tags:\'%s\''
|
|
},
|
|
data: {
|
|
tag: {
|
|
type: 'read',
|
|
resource: 'tags',
|
|
options: {slug: '%s'}
|
|
}
|
|
},
|
|
slugTemplate: true,
|
|
editRedirect: '/ghost/settings/tags/:slug/'
|
|
},
|
|
author: {
|
|
name: 'author',
|
|
route: '/' + config.get('routeKeywords').author + '/:slug/',
|
|
postOptions: {
|
|
filter: 'author:\'%s\''
|
|
},
|
|
data: {
|
|
author: {
|
|
type: 'read',
|
|
resource: 'users',
|
|
options: {slug: '%s'}
|
|
}
|
|
},
|
|
slugTemplate: true,
|
|
editRedirect: '/ghost/team/:slug/'
|
|
}
|
|
};
|
|
|
|
return defaults;
|
|
};
|
|
|
|
module.exports.list = function list() {
|
|
return channelConfig();
|
|
};
|
|
|
|
module.exports.get = function get(name) {
|
|
return _.cloneDeep(channelConfig()[name]);
|
|
};
|