2015-12-07 23:06:35 +03:00
|
|
|
var _ = require('lodash'),
|
|
|
|
config = require('../../config'),
|
|
|
|
getConfig;
|
2015-10-25 23:00:29 +03:00
|
|
|
|
2015-12-07 23:06:35 +03:00
|
|
|
getConfig = function getConfig(name) {
|
|
|
|
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',
|
|
|
|
route: '/' + config.routeKeywords.tag + '/:slug/',
|
|
|
|
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'}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
slugTemplate: true
|
2015-10-25 23:00:29 +03:00
|
|
|
},
|
2015-12-07 23:06:35 +03:00
|
|
|
author: {
|
|
|
|
name: 'author',
|
|
|
|
route: '/' + config.routeKeywords.author + '/:slug/',
|
|
|
|
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'}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
slugTemplate: true
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
return _.cloneDeep(defaults[name]);
|
2015-10-25 23:00:29 +03:00
|
|
|
};
|
|
|
|
|
2015-12-07 23:06:35 +03:00
|
|
|
module.exports = getConfig;
|