mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 19:52:01 +03:00
14 lines
296 B
JavaScript
14 lines
296 B
JavaScript
|
var config = require('../../config');
|
||
|
|
||
|
function getContextObject(data, context) {
|
||
|
var blog = config.theme,
|
||
|
contextObject;
|
||
|
|
||
|
context = context === 'page' ? 'post' : context;
|
||
|
contextObject = data[context] || blog;
|
||
|
|
||
|
return contextObject;
|
||
|
}
|
||
|
|
||
|
module.exports = getContextObject;
|