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]
14 lines
373 B
JavaScript
14 lines
373 B
JavaScript
var config = require('../../config'),
|
|
_ = require('lodash');
|
|
|
|
function getContextObject(data, context) {
|
|
var blog = config.get('theme'),
|
|
contextObject;
|
|
|
|
context = _.includes(context, 'page') || _.includes(context, 'amp') ? 'post' : context;
|
|
contextObject = data[context] || blog;
|
|
return contextObject;
|
|
}
|
|
|
|
module.exports = getContextObject;
|