mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
c2275ed131
refs #10181 Adds support to request a size in the img_url helper using syntax like: <img src="{{img_url profile_image size="small"}}"/> Requires the image_sizes config to be defined in the themes package.json
13 lines
399 B
JavaScript
13 lines
399 B
JavaScript
var _ = require('lodash'),
|
|
defaultConfig = require('./defaults'),
|
|
allowedKeys = ['posts_per_page', 'image_sizes'];
|
|
|
|
module.exports.create = function configLoader(packageJson) {
|
|
var config = _.cloneDeep(defaultConfig);
|
|
|
|
if (packageJson && packageJson.hasOwnProperty('config')) {
|
|
config = _.assign(config, _.pick(packageJson.config, allowedKeys));
|
|
}
|
|
|
|
return config;
|
|
};
|