mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-16 12:16:09 +03:00
a956d595f2
refs #5091, #6166 - fetch channel config via an internal function - prevents channel config from being statically cached at runtime - means that labs & other settings can be used to change these values
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
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;
|