0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/server/services/themes/config/index.js
2017-12-14 03:01:23 +01:00

13 lines
384 B
JavaScript

var _ = require('lodash'),
defaultConfig = require('./defaults'),
allowedKeys = ['posts_per_page'];
module.exports.create = function configLoader(packageJson) {
var config = _.cloneDeep(defaultConfig);
if (packageJson && packageJson.hasOwnProperty('config')) {
config = _.assign(config, _.pick(packageJson.config, allowedKeys));
}
return config;
};